CRM_Queue_TaskRunner
in package
`CRM_Queue_TaskRunner` a list tasks from a queue. It is designed to supported background tasks which run automatically.
This runner is not appropriate for all queues or workloads, so you might choose or create
a different runner. For example, CRM_Queue_Runner
is geared toward background task lists.
Tags
Table of Contents
Methods
- run() : string
- assertType() : mixed
- createContext() : CRM_Queue_TaskContext
- isRetriable() : bool
Methods
run()
public
run(CRM_Queue_Queue $queue, mixed $item) : string
Parameters
- $queue : CRM_Queue_Queue
- $item : mixed
Tags
Return values
string —One of the following:
- 'ok': Task executed normally. Removed from queue.
- 'retry': Task encountered an error. Will try again later.
- 'delete': Task encountered an error. Will not try again later. Removed from queue.
- 'abort': Task encountered an error. Will not try again later. Stopped the queue.
assertType()
private
assertType(mixed $object, array<string|int, mixed> $types, string $message) : mixed
Parameters
- $object : mixed
- $types : array<string|int, mixed>
- $message : string
createContext()
private
createContext(CRM_Queue_Queue $queue) : CRM_Queue_TaskContext
Parameters
- $queue : CRM_Queue_Queue
-
return CRM_Queue_TaskContext;
Return values
CRM_Queue_TaskContextisRetriable()
private
isRetriable(CRM_Queue_Queue $queue, mixed $item) : bool
Parameters
- $queue : CRM_Queue_Queue
- $item : mixed