function QueueWorker::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Queue/Attribute/QueueWorker.php \Drupal\Core\Queue\Attribute\QueueWorker::__construct()

Parameters

string $id: The plugin ID.

\Drupal\Core\StringTranslation\TranslatableMarkup|null $title: The human-readable title of the plugin.

array|null $cron: (optional) An associative array of settings for cron. The array has one key, time, which is set to the time Drupal cron should spend on calling this worker in seconds. The default is set in \Drupal\Core\Queue\QueueWorkerManager::processDefinition().

class-string|null $deriver: (optional) The deriver class.

File

core/lib/Drupal/Core/Queue/Attribute/QueueWorker.php, line 53

Class

QueueWorker
Declare a worker class for processing a queue item.

Namespace

Drupal\Core\Queue\Attribute

Code

public function __construct(public readonly string $id, public readonly ?TranslatableMarkup $title = NULL, public readonly ?array $cron = NULL, public readonly ?string $deriver = NULL) {
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.