use Drupal\Core\Queue\QueueInterface;
/**
* The queue object for a given name.
*/
protected QueueInterface $queue;
/**
* Constructs an object.
*
* @param \Drupal\Core\Queue\QueueInterface $queue
* The queue object for a given name.
*/
public function __construct(QueueInterface $queue) {
$this->queue = $queue;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('queue')->get('YOUR_QUEUE_ID'),
);
}