class Illuminate / Queue / Listener
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Listener

Properties

protected

$commandPath string

The command working path.

Default: null
protected

$environment string

The environment the workers should run under.

Default: null
protected

$sleep int

The amount of seconds to wait before polling the queue.

Default: 3
protected

$maxTries int

The number of times to try a job before logging it failed.

protected

$outputHandler Closure |null

The output handler callback.

Default: null

Methods

public

__construct ( $commandPath ) : void

Create a new queue listener.

Parameters

  • $commandPath string
protected

phpBinary ( ) : string

Get the PHP binary.

protected

artisanBinary ( ) : string

Get the Artisan binary.

public

listen ( $connection , $queue , ListenerOptions $options ) : void

Listen to the given queue connection.

Parameters

public

makeProcess ( $connection , $queue , ListenerOptions $options ) : Symfony\...\Process

Create a new Symfony process for the worker.

Parameters

protected

addEnvironment ( $command , ListenerOptions $options ) : array

Add the environment option to the given command.

Parameters

protected

createCommand ( $connection , $queue , ListenerOptions $options ) : array

Create the command with the listener options.

Parameters

public

runProcess ( Symfony\...\Process $process , $memory ) : void

Run the given process.

Parameters

  • $process Symfony\...\Process
  • $memory int
protected

handleWorkerOutput ( $type , $line ) : void

Handle output from the worker process.

Parameters

  • $type int
  • $line string
public

memoryExceeded ( $memoryLimit ) : bool

Determine if the memory limit has been exceeded.

Parameters

  • $memoryLimit int
public

stop ( ) : void

Stop listening and bail out of the script.

public

setOutputHandler ( Closure $outputHandler ) : void

Set the output handler callback.

Parameters