Skip to content

A Drupal module that provides a PriorityQueue class that can be used to process higher priority items before lower priority items.

Notifications You must be signed in to change notification settings

JulienD/priority_queue

Repository files navigation

Priority Queue

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

Requirements

  • None.

Installation

Install priority_queue as usual. See the Official documentation for furtherinformation.

Or use Composer.

composer require drupal/priority_queue

How it works

$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();

Contact

Current maintainers:

About

A Drupal module that provides a PriorityQueue class that can be used to process higher priority items before lower priority items.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages