Commit 9cb0e23e authored by catch's avatar catch

Issue #2359037 by jhodgdon, chx: QueueWorker plugin id is the queue name

parent 42eb466c
......@@ -10,18 +10,21 @@
use Drupal\Component\Annotation\Plugin;
/**
* Declare queue workers that need to be run periodically.
* Declare a worker class for processing a queue item.
*
* While there can be only one hook_cron() process running at the same time,
* there can be any number of processes defined here running. Because of
* this, long running tasks are much better suited for this API. Items queued
* in hook_cron() might be processed in the same cron run if there are not many
* items in the queue, otherwise it might take several requests, which can be
* run in parallel.
* Worker plugins are used by some queues for processing the individual items
* in the queue. In that case, the ID of the worker plugin needs to match the
* machine name of a queue, so that you can retrieve the queue back end by
* calling \Drupal\Core\Queue\QueueFactory::get($plugin_id).
*
* You can create queues, add items to them, claim them, etc. without using a
* QueueWorker plugin if you want, however, you need to take care of processing
* the items in the queue in that case. See \Drupal\Core\Cron for an example.
* \Drupal\Core\Cron::processQueues() processes queues that use workers; they
* can also be processed outside of the cron process.
*
* Some queues do not use worker plugins: you can create queues, add items to
* them, claim them, etc. without using a QueueWorker plugin. However, you will
* need to take care of processing the items in the queue in that case. You can
* look at \Drupal\Core\Cron::processQueues() for an example of how to process
* a queue that uses workers, and adapt it to your queue.
*
* Plugin Namespace: Plugin\QueueWorker
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment