![]() |
![]()
| ![]() |
![]()
NAMEQudo::Job - Qudo job class SYNOPSIS# You don't need to create job object by yourself. DESCRIPTIONQudo::Job object is passed to your worker and some hook points. METHODSidReturns job id. uniqkeyReturns the job unique key. func_idReturns the function id of the job. funcnameReturns the function name of the job. retry_cntReturns how many times the job is retried. grabbed_untilReturns time when job is grabbed. priorityReturns the priority of the job. argReturns the job argument. arg_originReturns the original argument before a serializer change. dbReturns the database the job belonging. managerReturns Qudo manager. job_start_timeReturns time when job started. completedSet job as completed successfully. is_completedIf job is completed, returns true. is_abortedIf job is aborted, returns true. is_failedIf job is failed, returns true. errorReturns error message set in failed or abort failed$job->failed($reason); Don't use this method in your worker class. Use die instead of this. $reason is set as error and logged in exception_log. abort$job->abort($reason); This aborts job. When this method is called, the job never retried even if you set retry_cnt is set. But, if you override work_safely in Qudo::Worker, it is depends on your implementation. $reason is set as error and logged in exception_log. replace$job->replace(['Worker::One', {arg => 'arg1'}], ['Worker::Another', {arg => 'arg2'}]); This enqueue new job(s) and current job itself is completed.
|