$queueId
$queueId : mixed
The queue ID.
If set, then it will load only the items from this queue. If NULL, load all queued items.
Abstract Queue Manager
The queue manager is used to load queued items and batch-process them.
If a "queue_id" is specified, only the item for this specific queue will be loaded. Otherwise, all unprocessed queue items will be processed.
The type of queue items can be set in extended concrete class with the
queue_item_proto()
method. This method should return a QueueItemInterface instance.
There are 4 available callback methods that can be set:
item_callback
QueueModelInterface $item
item_success_callback
item_failure_callback
processed_callback
array $success
, array $failures
setData(array $data) : \Charcoal\Queue\AbstractQueueManager
Set the manager's data.
array | $data | The queue data to set. |
Chainable
setQueueId(mixed $id) : \Charcoal\Queue\AbstractQueueManager
Set the queue's ID.
mixed | $id | The unique queue identifier. |
Chainable
setItemCallback(callable $callback) : \Charcoal\Queue\QueueManagerInterface
Set the callback routine when an item is processed.
callable | $callback | A item callback routine. |
Chainable
setItemSuccessCallback(callable $callback) : \Charcoal\Queue\QueueManagerInterface
Set the callback routine when the item is resolved.
callable | $callback | A item callback routine. |
Chainable
setItemFailureCallback(callable $callback) : \Charcoal\Queue\QueueManagerInterface
Set the callback routine when the item is rejected.
callable | $callback | A item callback routine. |
Chainable
setProcessedCallback(callable $callback) : \Charcoal\Queue\QueueManagerInterface
Set the callback routine when the queue is processed.
callable | $callback | A queue callback routine. |
Chainable
processQueue(callable $callback = null) : boolean
Process the items of the queue.
If no callback is passed and a self::$processedCallback is set, the latter is used.
callable | $callback | An optional alternative callback routine executed after all queue items are processed. |
Success / Failure
queueItemProto() : \Charcoal\Queue\QueueItemInterface
Retrieve the queue item's model.
setQueueItemFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Queue\QueueItemInterface
\Charcoal\Factory\FactoryInterface | $factory | The factory used to create queue items. |
Chainable