Skip to content

Instantly share code, notes, and snippets.

@pcambra
Created October 18, 2018 09:41
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Drupal 8: Process a queue programmatically
$queue_factory = \Drupal::service('queue');
$queue_manager = \Drupal::service('plugin.manager.queue_worker');
$queue_worker = $queue_manager->createInstance('queue_name');
$queue = $queue_factory->get('queue_name');
$item = $queue->claimItem();
$queue_worker->processItem($item->data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment