CronQueueTestBrokenQueue.php in Drupal 8
File
core/modules/system/tests/modules/cron_queue_test/src/Plugin/QueueWorker/CronQueueTestBrokenQueue.php
View source
<?php
namespace Drupal\cron_queue_test\Plugin\QueueWorker;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\Core\Queue\SuspendQueueException;
class CronQueueTestBrokenQueue extends QueueWorkerBase {
public function processItem($data) {
if ($data == 'crash') {
throw new SuspendQueueException('The queue is broken.');
}
}
}
Classes
Name |
Description |
CronQueueTestBrokenQueue |
Plugin annotation
@QueueWorker(
id = "cron_queue_test_broken_queue",
title = @Translation("Broken queue test"),
cron = {"time" = 60}
) |