ReportWorkerOne.php

Same filename in other branches
  1. 8.x-1.x cron_example/src/Plugin/QueueWorker/ReportWorkerOne.php
  2. 4.0.x modules/cron_example/src/Plugin/QueueWorker/ReportWorkerOne.php

Namespace

Drupal\cron_example\Plugin\QueueWorker

File

modules/cron_example/src/Plugin/QueueWorker/ReportWorkerOne.php

View source
<?php

namespace Drupal\cron_example\Plugin\QueueWorker;


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

}

Classes

Title Deprecated Summary
ReportWorkerOne A report worker.