public static function Drupal::queue

8.x Drupal.php public static Drupal::queue($name, $reliable = FALSE)

Returns a queue for the given queue name.

The following variables can be set by variable_set or $conf overrides:

  • queue_class_$name: The class to be used for the queue $name.
  • queue_default_class: The class to use when queue_class_$name is not defined. Defaults to \Drupal\Core\Queue\System, a reliable backend using SQL.
  • queue_default_reliable_class: The class to use when queue_class_$name is not defined and the queue_default_class is not reliable. Defaults to \Drupal\Core\Queue\System.

Parameters

string $name: The name of the queue to work with.

bool $reliable: (optional) TRUE if the ordering of items and guaranteeing every item executes at least once is important, FALSE if scalability is the main concern. Defaults to FALSE.

Return value

\Drupal\Core\Queue\QueueInterface The queue object for a given name.

8 calls to Drupal::queue()
aggregator_cron in drupal/core/modules/aggregator/aggregator.module
Implements hook_cron().
drupal_cron_run in drupal/core/includes/common.inc
Executes a cron run when called.
hook_cron in drupal/core/modules/system/system.api.php
Perform periodic actions.
update_fetch_data_batch in drupal/core/modules/update/update.fetch.inc
Batch callback: Processes a step in batch for fetching available update data.
update_install in drupal/core/modules/update/update.install
Implements hook_install().

... See full list

File

drupal/core/lib/Drupal.php, line 247
Contains Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function queue($name, $reliable = FALSE) {
  return static::$container->get('queue')->get($name, $reliable);
}