You are here

class CronQueueTestLeaseTime in Drupal 10

Plugin annotation


@QueueWorker(
  id = "cron_queue_test_lease_time",
  title = @Translation("Lease time test"),
  cron = {"time" = 100}
)

Hierarchy

Expanded class hierarchy of CronQueueTestLeaseTime

File

core/modules/system/tests/modules/cron_queue_test/src/Plugin/QueueWorker/CronQueueTestLeaseTime.php, line 14

Namespace

Drupal\cron_queue_test\Plugin\QueueWorker
View source
class CronQueueTestLeaseTime extends QueueWorkerBase {

  /**
   * {@inheritdoc}
   */
  public function processItem($data) {
    $state = \Drupal::state();
    $count = $state
      ->get('cron_queue_test_lease_time', 0);
    $count++;
    $state
      ->set('cron_queue_test_lease_time', $count);
    throw new \Exception('Leave me queued and leased!');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CronQueueTestLeaseTime::processItem public function Works on a single queue item. Overrides QueueWorkerInterface::processItem
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function
PluginBase::getDerivativeId public function
PluginBase::getPluginDefinition public function 2
PluginBase::getPluginId public function
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 53