class QueueManager implements Factory, Monitor mixin Queue (View source)

Properties

protected Application $app

The application instance.

protected array $connections

The array of resolved queue connections.

protected array $connectors

The array of resolved queue connectors.

Methods

__construct(Application $app)

Create a new queue manager instance.

void
before(mixed $callback)

Register an event listener for the before job event.

void
after(mixed $callback)

Register an event listener for the after job event.

void
exceptionOccurred(mixed $callback)

Register an event listener for the exception occurred job event.

void
looping(mixed $callback)

Register an event listener for the daemon queue loop.

void
failing(mixed $callback)

Register an event listener for the failed job event.

void
starting(mixed $callback)

Register an event listener for the daemon queue starting.

void
stopping(mixed $callback)

Register an event listener for the daemon queue stopping.

bool
connected(string|null $name = null)

Determine if the driver is connected.

connection(string|null $name = null)

Resolve a queue connection instance.

resolve(string $name)

Resolve a queue connection.

getConnector(string $driver)

Get the connector for a given driver.

void
pause(string $connection, string $queue)

Pause a queue by its connection and name.

void
pauseFor(string $connection, string $queue, DateTimeInterface|DateInterval|int $ttl)

Pause a queue by its connection and name for a given amount of time.

void
resume(string $connection, string $queue)

Resume a paused queue by its connection and name.

bool
isPaused(string $connection, string $queue)

Determine if a queue is paused.

void
withoutInterruptionPolling()

Indicate that queue workers should not poll for restart or pause signals.

void
extend(string $driver, Closure $resolver)

Add a queue connection resolver.

void
addConnector(string $driver, Closure $resolver)

Add a queue connection resolver.

array|null
getConfig(string $name)

Get the queue connection configuration.

string
getDefaultDriver()

Get the name of the default queue connection.

void
setDefaultDriver(string $name)

Set the name of the default queue connection.

string
getName(string|null $connection = null)

Get the full name for the given connection.

getApplication()

Get the application instance used by the manager.

$this
setApplication(Application $app)

Set the application instance used by the manager.

mixed
__call(string $method, array $parameters)

Dynamically pass calls to the default connection.

Details

__construct(Application $app)

Create a new queue manager instance.

Parameters

Application $app

void before(mixed $callback)

Register an event listener for the before job event.

Parameters

mixed $callback

Return Value

void

void after(mixed $callback)

Register an event listener for the after job event.

Parameters

mixed $callback

Return Value

void

void exceptionOccurred(mixed $callback)

Register an event listener for the exception occurred job event.

Parameters

mixed $callback

Return Value

void

void looping(mixed $callback)

Register an event listener for the daemon queue loop.

Parameters

mixed $callback

Return Value

void

void failing(mixed $callback)

Register an event listener for the failed job event.

Parameters

mixed $callback

Return Value

void

void starting(mixed $callback)

Register an event listener for the daemon queue starting.

Parameters

mixed $callback

Return Value

void

void stopping(mixed $callback)

Register an event listener for the daemon queue stopping.

Parameters

mixed $callback

Return Value

void

bool connected(string|null $name = null)

Determine if the driver is connected.

Parameters

string|null $name

Return Value

bool

Queue connection(string|null $name = null)

Resolve a queue connection instance.

Parameters

string|null $name

Return Value

Queue

protected Queue resolve(string $name)

Resolve a queue connection.

Parameters

string $name

Return Value

Queue

Exceptions

InvalidArgumentException

protected ConnectorInterface getConnector(string $driver)

Get the connector for a given driver.

Parameters

string $driver

Return Value

ConnectorInterface

Exceptions

InvalidArgumentException

void pause(string $connection, string $queue)

Pause a queue by its connection and name.

Parameters

string $connection
string $queue

Return Value

void

void pauseFor(string $connection, string $queue, DateTimeInterface|DateInterval|int $ttl)

Pause a queue by its connection and name for a given amount of time.

Parameters

string $connection
string $queue
DateTimeInterface|DateInterval|int $ttl

Return Value

void

void resume(string $connection, string $queue)

Resume a paused queue by its connection and name.

Parameters

string $connection
string $queue

Return Value

void

bool isPaused(string $connection, string $queue)

Determine if a queue is paused.

Parameters

string $connection
string $queue

Return Value

bool

void withoutInterruptionPolling()

Indicate that queue workers should not poll for restart or pause signals.

This prevents the workers from hitting the application cache to determine if they need to pause or restart.

Return Value

void

void extend(string $driver, Closure $resolver)

Add a queue connection resolver.

Parameters

string $driver
Closure $resolver

Return Value

void

void addConnector(string $driver, Closure $resolver)

Add a queue connection resolver.

Parameters

string $driver
Closure $resolver

Return Value

void

protected array|null getConfig(string $name)

Get the queue connection configuration.

Parameters

string $name

Return Value

array|null

string getDefaultDriver()

Get the name of the default queue connection.

Return Value

string

void setDefaultDriver(string $name)

Set the name of the default queue connection.

Parameters

string $name

Return Value

void

string getName(string|null $connection = null)

Get the full name for the given connection.

Parameters

string|null $connection

Return Value

string

Application getApplication()

Get the application instance used by the manager.

Return Value

Application

$this setApplication(Application $app)

Set the application instance used by the manager.

Parameters

Application $app

Return Value

$this

mixed __call(string $method, array $parameters)

Dynamically pass calls to the default connection.

Parameters

string $method
array $parameters

Return Value

mixed