public static function Drupal::queue

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.

9 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.
UpdateCoreTest::testFetchTasks in drupal/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php
Tests that exactly one fetch task per project is created and not more.
update_fetch_data_batch in drupal/core/modules/update/update.fetch.inc
Batch callback: Processes a step in batch for fetching available update data.

... 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);
}