Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / Annotation / QueueWorker.php
1 <?php
2
3 namespace Drupal\Core\Annotation;
4
5 use Drupal\Component\Annotation\Plugin;
6
7 /**
8  * Declare a worker class for processing a queue item.
9  *
10  * Worker plugins are used by some queues for processing the individual items
11  * in the queue. In that case, the ID of the worker plugin needs to match the
12  * machine name of a queue, so that you can retrieve the queue back end by
13  * calling \Drupal\Core\Queue\QueueFactory::get($plugin_id).
14  *
15  * \Drupal\Core\Cron::processQueues() processes queues that use workers; they
16  * can also be processed outside of the cron process.
17  *
18  * Some queues do not use worker plugins: you can create queues, add items to
19  * them, claim them, etc. without using a QueueWorker plugin. However, you will
20  * need to take care of processing the items in the queue in that case. You can
21  * look at \Drupal\Core\Cron::processQueues() for an example of how to process
22  * a queue that uses workers, and adapt it to your queue.
23  *
24  * Plugin Namespace: Plugin\QueueWorker
25  *
26  * For a working example, see
27  * \Drupal\aggregator\Plugin\QueueWorker\AggregatorRefresh.
28  *
29  * @see \Drupal\Core\Queue\QueueWorkerInterface
30  * @see \Drupal\Core\Queue\QueueWorkerBase
31  * @see \Drupal\Core\Queue\QueueWorkerManager
32  * @see plugin_api
33  *
34  * @Annotation
35  */
36 class QueueWorker extends Plugin {
37
38   /**
39    * The plugin ID.
40    *
41    * @var string
42    */
43   public $id;
44
45   /**
46    * The human-readable title of the plugin.
47    *
48    * @ingroup plugin_translatable
49    *
50    * @var \Drupal\Core\Annotation\Translation
51    */
52   public $title;
53
54   /**
55    * An associative array containing the optional key:
56    *   - time: (optional) How much time Drupal cron should spend on calling
57    *     this worker in seconds. Defaults to 15.
58    *
59    * @var array (optional)
60    */
61   public $cron;
62
63 }