QueueManager
class QueueManager implements Factory, Monitor mixin Queue
Traits
Properties
| protected Closure> | $releaseCallbacks | from HasPoolProxy | |
| protected array | $connections | The array of resolved queue connections. |
|
| protected array | $connectors | The array of resolved queue connectors. |
|
| protected array | $poolables | The array of drivers which will be wrapped as pool proxies. |
Methods
Create a pool proxy for an immutable definition.
Build a namespaced pool definition for a pooled resource.
Get the shared object-pool factory.
Get the release callback for a pooled driver.
Add a driver to the poolable-driver list.
Remove a driver from the poolable-driver list.
Resolve the default connection name for a given queueable instance.
Resolve the default queue name for a given queueable instance.
Register an event listener for the before job event.
Register an event listener for the after job event.
Register an event listener for the exception occurred job event.
Register an event listener for the daemon queue loop.
Register an event listener for the failed job event.
Register an event listener for the daemon queue starting.
Register an event listener for the daemon queue stopping.
Register the default queue route for a given class.
Pause a queue by its connection and name.
Pause a queue by its connection and name for a given amount of time.
Resume a paused queue by its connection and name.
Determine if a queue is paused.
Determine which of the given queues are currently paused.
Indicate that queue workers should not poll for restart or pause signals.
Determine if the driver is connected.
Resolve a queue connection instance.
Get the connector for a given driver.
Get the queue connection configuration.
Get the name of the default queue connection.
Set the name of the default queue connection.
Get the full name for the given connection.
Disconnect a queue connection and close its shared resource pool.
Get the application instance used by the manager.
Dynamically pass calls to the default connection.
Details
in
HasPoolProxy at line 24
protected mixed
createPoolProxy(string $driver, Closure $resolver, PoolDefinition $definition, string $proxyClass)
Create a pool proxy for an immutable definition.
in
HasPoolProxy at line 45
protected PoolDefinition
poolDefinition(string $resource, array $poolConfig, array $fingerprintSource)
Build a namespaced pool definition for a pooled resource.
at line 362
protected Factory
poolFactory()
Get the shared object-pool factory.
in
HasPoolProxy at line 71
HasPoolProxy
setReleaseCallback(string $driver, Closure $callback)
Set the release callback for a pooled driver.
Boot-only. The callback persists on the manager for the worker lifetime and is captured by every subsequently created proxy for the driver.
in
HasPoolProxy at line 81
Closure|null
getReleaseCallback(string $driver)
Get the release callback for a pooled driver.
in
HasPoolProxy at line 93
HasPoolProxy
addPoolable(string $driver)
Add a driver to the poolable-driver list.
Boot-only. The list persists on the manager for the worker lifetime and is consulted on subsequent driver creation. Per-request use races across coroutines and does not affect already-cached drivers.
in
HasPoolProxy at line 109
HasPoolProxy
removePoolable(string $driver)
Remove a driver from the poolable-driver list.
Boot-only. The list persists on the manager for the worker lifetime and is consulted on subsequent driver creation. Per-request use races across coroutines and does not affect already-cached drivers.
in
HasPoolProxy at line 126
array
getPoolables()
Get the poolable-driver list.
in
HasPoolProxy at line 138
HasPoolProxy
setPoolables(array $poolables)
Set the poolable-driver list.
Boot-only. The list persists on the manager for the worker lifetime and is consulted on subsequent driver creation. Per-request use races across coroutines and does not affect already-cached drivers.
in
ResolvesQueueRoutes at line 15
string|null
resolveConnectionFromQueueRoute(object $queueable)
Resolve the default connection name for a given queueable instance.
in
ResolvesQueueRoutes at line 23
string|null
resolveQueueFromQueueRoute(object $queueable)
Resolve the default queue name for a given queueable instance.
in
ResolvesQueueRoutes at line 31
protected QueueRoutes
queueRoutes()
Get the queue routes manager instance.
at line 50
__construct(Container $app)
Create a new queue manager instance.
at line 61
void
before(mixed $callback)
Register an event listener for the before job event.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 73
void
after(mixed $callback)
Register an event listener for the after job event.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 85
void
exceptionOccurred(mixed $callback)
Register an event listener for the exception occurred job event.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 97
void
looping(mixed $callback)
Register an event listener for the daemon queue loop.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 109
void
failing(mixed $callback)
Register an event listener for the failed job event.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 121
void
starting(mixed $callback)
Register an event listener for the daemon queue starting.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 133
void
stopping(mixed $callback)
Register an event listener for the daemon queue stopping.
Boot-only. The listener persists on the singleton event dispatcher for the worker lifetime and runs for every subsequent matching queue event.
at line 147
void
route(array|string $class, UnitEnum|string|null $queue = null, UnitEnum|string|null $connection = null)
Register the default queue route for a given class.
Boot-only. The route persists on the singleton QueueRoutes registry for the worker lifetime and affects every subsequent dispatch of that class.
at line 155
void
pause(string $connection, string $queue)
Pause a queue by its connection and name.
at line 170
void
pauseFor(string $connection, string $queue, DateInterval|DateTimeInterface|int $ttl)
Pause a queue by its connection and name for a given amount of time.
at line 185
void
resume(string $connection, string $queue)
Resume a paused queue by its connection and name.
at line 200
bool
isPaused(string $connection, string $queue)
Determine if a queue is paused.
at line 211
array
getPausedQueues(string $connection, array $queues)
Determine which of the given queues are currently paused.
at line 232
void
withoutInterruptionPolling()
Indicate that queue workers should not poll for restart or pause signals.
Boot-only. Mutates process-global worker flags; runtime use races across coroutines and changes every concurrent worker pause or restart check.
at line 241
bool
connected(UnitEnum|string|null $name = null)
Determine if the driver is connected.
at line 257
Queue
connection(UnitEnum|string|null $name = null)
Resolve a queue connection instance.
at line 282
protected Queue
resolve(string $name)
Resolve a queue connection.
at line 316
protected ConnectorInterface
getConnector(string $driver)
Get the connector for a given driver.
at line 331
void
extend(string $driver, Closure $resolver)
Add a queue connection resolver.
Boot-only. The resolver persists in the singleton's connectors array for the worker lifetime and applies to every subsequent connection.
at line 342
void
addConnector(string $driver, Closure $resolver)
Add a queue connection resolver.
Boot-only. The resolver persists in the singleton's connectors array for the worker lifetime and applies to every subsequent connection.
at line 350
protected array|null
getConfig(string $name)
Get the queue connection configuration.
at line 370
string
getDefaultDriver()
Get the name of the default queue connection.
at line 380
void
setDefaultDriver(UnitEnum|string $name)
Set the name of the default queue connection.
Boot-only. Mutates process-global config; per-request use races across coroutines.
at line 390
string
getName(string|null $connection = null)
Get the full name for the given connection.
at line 404
void
purge(string|null $name = null)
Disconnect a queue connection and close its shared resource pool.
Boot or tests only, plus operational recovery of broken pooled resources. Other connections sharing the pool transparently acquire a fresh pool on their next operation.
at line 440
Container
getApplication()
Get the application instance used by the manager.
at line 452
QueueManager
setApplication(Container $app)
Set the application instance used by the manager.
Tests only. Swaps the container reference on the singleton and on every cached queue connection; per-request use races across coroutines and breaks every concurrent dispatch.
at line 473
__call(string $method, array $parameters)
Dynamically pass calls to the default connection.