QueueWorkerManager.php in Drupal 8
File
core/lib/Drupal/Core/Queue/QueueWorkerManager.php
View source
<?php
namespace Drupal\Core\Queue;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class QueueWorkerManager extends DefaultPluginManager implements QueueWorkerManagerInterface {
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/QueueWorker', $namespaces, $module_handler, 'Drupal\\Core\\Queue\\QueueWorkerInterface', 'Drupal\\Core\\Annotation\\QueueWorker');
$this
->setCacheBackend($cache_backend, 'queue_plugins');
$this
->alterInfo('queue_info');
}
public function processDefinition(&$definition, $plugin_id) {
parent::processDefinition($definition, $plugin_id);
if (isset($definition['cron'])) {
$definition['cron'] += [
'time' => 15,
];
}
}
public function createInstance($plugin_id, array $configuration = []) {
return parent::createInstance($plugin_id, $configuration);
}
}