You are here

ItemWarmer.php in Warmer 2.x

Same filename and directory in other branches
  1. 8 src/Plugin/QueueWorker/ItemWarmer.php

File

src/Plugin/QueueWorker/ItemWarmer.php
View source
<?php

namespace Drupal\warmer\Plugin\QueueWorker;

use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\warmer\QueueData;

/**
 * Process the items queued for warming.
 *
 * @QueueWorker(
 *   id = "warmer",
 *   title = @Translation("Cache warmer"),
 *   cron = {"time" = 60}
 * )
 */
class ItemWarmer extends QueueWorkerBase {

  /**
   * {@inheritdoc}
   */
  public function processItem($data) {
    if (!$data instanceof QueueData) {
      return;
    }
    $data
      ->process();
  }

}

Classes

Namesort descending Description
ItemWarmer Process the items queued for warming.