CRM_Queue_Queue_BatchQueueInterface
in
Variation on CRM_Queue_Queue which can claim/release/delete items in batches.
Table of Contents
Methods
- claimItems() : object
- Get a batch of queue items.
- deleteItems() : void
- Remove items from the queue.
- fetchItems() : array<string|int, mixed>
- Get the full data for multiple items.
- releaseItems() : void
- Return an item that could not be processed.
Methods
claimItems()
Get a batch of queue items.
public
claimItems(int $limit[, int|null $lease_time = NULL ]) : object
Parameters
- $limit : int
-
Maximum number of records to claim
- $lease_time : int|null = NULL
-
Hold a lease on the claimed item for $X seconds. If NULL, inherit a default.
Return values
object —with key 'data' that matches the inputted data
deleteItems()
Remove items from the queue.
public
deleteItems(array<string|int, mixed> $items) : void
Parameters
- $items : array<string|int, mixed>
-
The item returned by claimItem.
fetchItems()
Get the full data for multiple items.
public
fetchItems(array<string|int, mixed> $ids) : array<string|int, mixed>
This is a passive peek - it does not claim/steal/release anything.
Parameters
- $ids : array<string|int, mixed>
-
The unique IDs of the tasks within the queue.
Return values
array<string|int, mixed>releaseItems()
Return an item that could not be processed.
public
releaseItems(array<string|int, mixed> $items) : void
Parameters
- $items : array<string|int, mixed>
-
The items returned by claimItem.