Listener
class Listener (View source)
Properties
protected string | $commandPath | The command working path. |
|
protected string | $environment | The environment the workers should run under. |
|
protected int | $sleep | The amount of seconds to wait before polling the queue. |
|
protected int | $maxTries | The number of times to try a job before logging it failed. |
|
protected Closure|null | $outputHandler | The output handler callback. |
Methods
Create a new queue listener.
Get the PHP binary.
Get the Artisan binary.
Listen to the given queue connection.
Create a new Symfony process for the worker.
Add the environment option to the given command.
Create the command with the listener options.
Run the given process.
Handle output from the worker process.
Determine if the memory limit has been exceeded.
Stop listening and bail out of the script.
Details
void
listen(string $connection, string $queue, ListenerOptions $options)
Listen to the given queue connection.
Process
makeProcess(string $connection, string $queue, ListenerOptions $options)
Create a new Symfony process for the worker.
protected array
addEnvironment(array $command, ListenerOptions $options)
Add the environment option to the given command.
protected array
createCommand(string $connection, string $queue, ListenerOptions $options)
Create the command with the listener options.