ReportWorkerTwo.php

Same filename in other branches
  1. 3.x modules/cron_example/src/Plugin/QueueWorker/ReportWorkerTwo.php
  2. 4.0.x modules/cron_example/src/Plugin/QueueWorker/ReportWorkerTwo.php

Namespace

Drupal\cron_example\Plugin\QueueWorker

File

cron_example/src/Plugin/QueueWorker/ReportWorkerTwo.php

View source
<?php

namespace Drupal\cron_example\Plugin\QueueWorker;


/**
 * A report worker.
 *
 * @QueueWorker(
 *   id = "cron_example_queue_2",
 *   title = @Translation("Second worker in cron_example"),
 *   cron = {"time" = 20}
 * )
 *
 * QueueWorkers are new in Drupal 8. They define a queue, which in this case
 * is identified as cron_example_queue_2 and contain a process that operates on
 * all the data given to the queue.
 *
 * @see queue_example.module
 */
class ReportWorkerTwo extends ReportWorkerBase {
    
    /**
     * {@inheritdoc}
     */
    public function processItem($data) {
        $this->reportWork(2, $data);
    }

}

Classes

Title Deprecated Summary
ReportWorkerTwo A report worker.