Provides a PriorityQueue class that can be used to process higher priority items before lower priority items.
-
For a full description of the module, visit the Project page
-
To submit bug reports and feature suggestions, or to track changes go to the Issue Tracker
- None.
Install priority_queue as usual. See the Official documentation for furtherinformation.
Or use Composer.
composer require drupal/priority_queue
$queue_factory = \Drupal::service('queue.priority_queue');
$queue = $queue_factory->get('test_queue');
$queue->createItem('LAST', -10);
$queue->createItem('FIRST', 10);
$queue->createItem('MIDDLE');
// Items will be processed by priority. In the above example the first item will be 'FIRST' since it has the highest priority of 10, and 'LAST' being last since it has the lowest priority of -10.
$item = $queue->claimItem();
Current maintainers: