Skip to content

QueueManager

App-facing entry point: $container->get(QueueManager::class)->push(SendWelcomeEmail::class, ['userId' => 5]).

Resolves the configured driver (or an explicit alias) from QueueDriverRegistry via Container::get() — a driver is a long-lived service (memoized like any other), not a fresh-per-call action/view, so a persistent driver’s own service factory (e.g. quioteframework/queue-db’s QueueDbPlugin resolving a real PDO connection) runs instead of raw constructor autowiring.

final readonly class QueueManager

SourceQueueManager.php

public function __construct(Container $container, QueueConfig $config, ClockInterface $clock = new SystemClock(…)): mixed

ParameterTypeDescription
$containerContainer
$configQueueConfig
$clockClockInterface

Returns mixed

MethodDescription
driver(?string $alias = null): QueueDriverInterfaceResolves a queue driver by alias, defaulting to queue.default_driver.
push(class-string<Job> $jobClass, array<string, mixed> $params = [], ?int $delaySeconds = null): void

public function driver(?string $alias = null): QueueDriverInterface

Resolves a queue driver by alias, defaulting to queue.default_driver.

The alias is translated to a class through QueueDriverRegistry and the instance comes from the container, so a driver registered with its own service factory is built by that factory and memoized as a singleton.

ParameterTypeDescription
$alias?``string

Returns QueueDriverInterface

ThrowsWhen
RuntimeExceptionif the alias is unknown to the registry, or the resolved service does not implement QueueDriverInterface.

public function push(class-string<Job> $jobClass, array<string, mixed> $params = [], ?int $delaySeconds = null): void

ParameterTypeDescription
$jobClassclass-string``<Job>
$paramsarray``<``string``, ``mixed``>
$delaySeconds?``int