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.
Synopsis
Section titled “Synopsis”final readonly class QueueManager
| Source | QueueManager.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(Container $container, QueueConfig $config, ClockInterface $clock = new SystemClock(…)): mixed
| Parameter | Type | Description |
|---|---|---|
$container | Container | |
$config | QueueConfig | |
$clock | ClockInterface |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
driver(?string $alias = null): QueueDriverInterface | Resolves a queue driver by alias, defaulting to queue.default_driver. |
push(class-string<Job> $jobClass, array<string, mixed> $params = [], ?int $delaySeconds = null): void |
driver()
Section titled “driver()”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.
| Parameter | Type | Description |
|---|---|---|
$alias | ?``string |
Returns QueueDriverInterface
| Throws | When |
|---|---|
RuntimeException | if the alias is unknown to the registry, or the resolved service does not implement QueueDriverInterface. |
push()
Section titled “push()”public function push(class-string<Job> $jobClass, array<string, mixed> $params = [], ?int $delaySeconds = null): void
| Parameter | Type | Description |
|---|---|---|
$jobClass | class-string``<Job> | |
$params | array``<``string``, ``mixed``> | |
$delaySeconds | ?``int |