class RoutingQueue implements Queue
Wraps the queue connection so jobs are routed onto their registered queue when they are pushed.
Laravel's native queue routing ({\Illuminate\Queue\QueueRoutes}) is only applied by the bus dispatcher (`dispatch()`); the low-level `push()` — which most of Flarum and its extensions use — bypasses it. This wrapper closes that gap: when a job is pushed with no explicit queue, its class is looked up in the route map (which resolves through the class hierarchy: parents, interfaces, traits) and the resulting queue is applied. An explicit queue always wins; an unrouted job falls through to the driver default. It wraps whatever connection is bound to `flarum.queue.connection` (core's or a replacement from FoF Redis / Horizon), so routing is driver-independent. Everything other than the routing decision is delegated to the wrapped connection, including methods beyond the Queue contract (via `__call`); the underlying driver is available through {\Flarum\Queue\getDriver()} for the few callers that need the concrete instance.
Methods
Resolve the queue for a job: an explicit queue wins; otherwise the route registered for the job's class (or an ancestor); otherwise null (driver default). Only job objects can be routed — string job names pass through.
Delegate any method beyond the Queue contract to the wrapped driver (drivers expose extra methods — setContainer(), getConnectionConfig(), etc. — that callers rely on).
Details
at
line 36
__construct(Queue $driver, QueueRoutes $routes)
at
line 45
Queue
getDriver()
The wrapped driver connection.
at
line 58
protected string|null
routeFor(mixed $job, string|null $queue)
Resolve the queue for a job: an explicit queue wins; otherwise the route registered for the job's class (or an ancestor); otherwise null (driver default). Only job objects can be routed — string job names pass through.
at
line 67
push($job, $data = '', $queue = null)
at
line 72
later($delay, $job, $data = '', $queue = null)
at
line 77
bulk($jobs, $data = '', $queue = null)
at
line 98
pushOn($queue, $job, $data = '')
at
line 103
laterOn($queue, $delay, $job, $data = '')
at
line 108
pushRaw($payload, $queue = null, array $options = [])
at
line 113
pop($queue = null)
at
line 118
size($queue = null)
at
line 123
pendingSize($queue = null)
at
line 128
delayedSize($queue = null)
at
line 133
reservedSize($queue = null)
at
line 138
creationTimeOfOldestPendingJob($queue = null)
at
line 143
getConnectionName()
at
line 148
setConnectionName($name)
at
line 165
mixed
__call(string $name, array<int,mixed> $arguments)
Delegate any method beyond the Queue contract to the wrapped driver (drivers expose extra methods — setContainer(), getConnectionConfig(), etc. — that callers rely on).