This module allows you to create a new queue made of several, already existing, child queues in a specific order.
When the group queue is processed, items are returned from their individual child queues until no more items are left in each, with queues sorted in the queue group's defined order. You can still process component child queues as usual as standalone queues.
Example
Suppose you create a group queue, named group1 consisting in queue1 and queue2.
However, if you process the newly declared group1 grouped queue, you will get items for processing from queue1 as long as it has items ready. Items on queue2 will not be processed until queue1 has no more items ready. As long as queue1 has no items ready, items will now be processed from queue2. As soon as items get added to queue1, they will be the next ones to be processed when running group1.
Configuration
Under the key group_queues add as many array items declaring the queue group name as the key and the child queues as a nested array value, in the desired order of precedence.
$conf['group_queues'] = array(
'group1' => array(
'queue1',
'queue2',
),
// Create more queue groups here...
);
For each defined group queue, you should also change the queue backend class like this:
$conf['queue_class_YOUR_GROUP_QUEUE_NAME'] = 'GroupQueue';
Todo
- Configuration UI
- Speed things up a bit by caching hook_cron_queue_info() invocations (optional)
- Allow disabling individual child queues
Write tests- Add more tests
Acknowledgements
The users fmonfort and namaya also contributed to the initial release of this module.
Project information
1 site reports using this module
- Created by amontero on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.