Priority Queue

Categories

Component ID

2469119

Component name

Priority Queue

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

293

Component created

Component changed

Component body

Provides a PriorityQueue class that can be used to process higher priority items before lower priority items.

Usage:

// Ensure the PriorityQueue class is used for the 'test_queue' class.
variable_set('queue_class_test_queue', 'PriorityQueue');

$queue = DrupalQueue::get('test_queue');
$queue->createItem('LAST', -10);
$queue->createItem('FIRST', 10);
$queue->createItem('MIDDLE', 0);
// The items will be processed with 'FIRST' being first since it has the highest priority of 10, and 'LAST' being last since it has the lowest priority of -10.