CRM_Queue_Runner
class CRM_Queue_Runner
The queue runner is a helper which runs all jobs in a queue.
The queue runner is most useful for one-off queues (such as an upgrade); if the intention is to develop a dedicated, long-running worker thread, then one should consider writing a new queue consumer.
Constants
ERROR_CONTINUE |
The failed task should be discarded, and queue processing should continue. |
ERROR_ABORT |
The failed task should be kept in the queue, and queue processing should abort. |
Properties
string | $title | ||
CRM_Queue_Queue | $queue | ||
$errorMode | |||
$isMinimal | |||
$onEnd | |||
$onEndUrl | |||
$pathPrefix | |||
int | $qrid | queue-runner id; used for persistence | |
array | $buttons | ||
CRM_Queue_TaskContext | $taskCtx |
Methods
Locate a previously-created instance of the queue-runner.
FIXME: parameter validation FIXME: document signature of onEnd callback
No description
Redirect to the web-based queue-runner and evaluate all tasks in a queue.
Immediately run all tasks in a queue (until either reaching the end of the queue or encountering an error)
Take the next item from the queue and attempt to run it.
Take the next item from the queue and attempt to run it.
Release an item in keeping with the error mode.
No description
Format a result record which describes whether the task completed.
No description
Details
at line 86
static CRM_Queue_Runner|NULL
instance(string $qrid)
Locate a previously-created instance of the queue-runner.
at line 110
__construct(array $runnerSpec)
FIXME: parameter validation FIXME: document signature of onEnd callback
at line 126
array
__sleep()
at line 144
runAllViaWeb()
Redirect to the web-based queue-runner and evaluate all tasks in a queue.
at line 161
mixed
runAll()
Immediately run all tasks in a queue (until either reaching the end of the queue or encountering an error)
If the runner has an onEndUrl, then this function will not return
at line 203
array
runNext(bool $useSteal = FALSE)
Take the next item from the queue and attempt to run it.
Individual tasks may also throw exceptions -- caller should watch for exceptions.
at line 255
array
skipNext(bool $useSteal = FALSE)
Take the next item from the queue and attempt to run it.
Individual tasks may also throw exceptions -- caller should watch for exceptions.
at line 279
protected
releaseErrorItem(object $item)
Release an item in keeping with the error mode.
at line 296
array
handleEnd()
at line 327
array
formatTaskResult(bool $isOK, Exception|NULL $exception = NULL)
Format a result record which describes whether the task completed.