Created
October 18, 2018 09:41
-
-
Save pcambra/4979c15b4856a8ada4866d97ac4820ff to your computer and use it in GitHub Desktop.
Drupal 8: Process a queue programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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