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 | |||
$qrid | |||
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 83
static CRM_Queue_Runner|NULL
instance(string $qrid)
Locate a previously-created instance of the queue-runner.
at line 107
__construct(array $runnerSpec)
FIXME: parameter validation FIXME: document signature of onEnd callback
at line 123
array
__sleep()
at line 141
runAllViaWeb()
Redirect to the web-based queue-runner and evaluate all tasks in a queue.
at line 158
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 200
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 252
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 276
protected
releaseErrorItem(object $item)
Release an item in keeping with the error mode.
at line 293
array
handleEnd()
at line 324
array
formatTaskResult(bool $isOK, Exception|NULL $exception = NULL)
Format a result record which describes whether the task completed.