3 namespace Drupal\Core\Queue;
5 use Drupal\Core\Database\Connection;
8 * Defines the key/value store factory for the database backend.
10 class QueueDatabaseFactory {
13 * The database connection.
15 * @var \Drupal\Core\Database\Connection $connection
17 protected $connection;
20 * Constructs this factory object.
22 * @param \Drupal\Core\Database\Connection $connection
23 * The Connection object containing the key-value tables.
25 public function __construct(Connection $connection) {
26 $this->connection = $connection;
30 * Constructs a new queue object for a given name.
33 * The name of the collection holding key and value pairs.
35 * @return \Drupal\Core\Queue\DatabaseQueue
36 * A key/value store implementation for the given $collection.
38 public function get($name) {
39 return new DatabaseQueue($name, $this->connection);