Skip to content

Instantly share code, notes, and snippets.

@pcambra
Created Oct 18, 2018
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