public QueueFactory::get($name, $reliable = FALSE)
Constructs a new queue.
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.
\Drupal\Core\Queue\QueueInterface A queue implementation for the given name.
public function get($name, $reliable = FALSE) { if (!isset($this->queues[$name])) { // If it is a reliable queue, check the specific settings first. if ($reliable) { $service_name = $this->settings->get('queue_reliable_service_' . $name); } // If no reliable queue was defined, check the service and global // settings, fall back to queue.database. if (empty($service_name)) { $service_name = $this->settings->get('queue_service_' . $name, $this->settings->get('queue_default', 'queue.database')); } $this->queues[$name] = $this->container->get($service_name)->get($name); } return $this->queues[$name]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Queue!QueueFactory.php/function/QueueFactory::get/8.1.x