CRM_Queue_Queue
abstract class CRM_Queue_Queue
A queue is an object (usually backed by some persistent data store) which stores a list of tasks or messages for use by other processes.
This would ideally be an interface, but it's handy to specify the "function __construct()" and the "$name" handling
Note: This interface closely parallels the DrupalQueueInterface.
Methods
Create a reference to queue. After constructing the queue, one should usually call createQueue (if it's a new queue) or loadQueue (if it's known to be an existing queue).
Determine the string name of this queue.
Perform any registation or resource-allocation for a new queue
Perform any loading or pre-fetch for an existing queue.
Release any resources claimed by the queue (memory, DB rows, etc)
Check if the queue exists.
Add a new item to the queue.
Determine number of items remaining in the queue.
Get the next item.
Get the next item, even if there's an active lease
Remove an item from the queue.
Return an item that could not be processed.
Details
at line 58
__construct(array $queueSpec)
Create a reference to queue. After constructing the queue, one should usually call createQueue (if it's a new queue) or loadQueue (if it's known to be an existing queue).
at line 67
string
getName()
Determine the string name of this queue.
at line 74
abstract
createQueue()
Perform any registation or resource-allocation for a new queue
at line 79
abstract
loadQueue()
Perform any loading or pre-fetch for an existing queue.
at line 84
abstract
deleteQueue()
Release any resources claimed by the queue (memory, DB rows, etc)
at line 91
abstract bool
existsQueue()
Check if the queue exists.
at line 102
abstract
createItem(mixed $data, array $options = [])
Add a new item to the queue.
at line 109
abstract int
numberOfItems()
Determine number of items remaining in the queue.
at line 120
abstract object
claimItem(int $lease_time = 3600)
Get the next item.
at line 131
abstract object
stealItem(int $lease_time = 3600)
Get the next item, even if there's an active lease
at line 139
abstract
deleteItem(object $item)
Remove an item from the queue.
at line 147
abstract
releaseItem(object $item)
Return an item that could not be processed.