Property | Type | Description | |
---|---|---|---|
$cache | Illuminate\Contracts\Cache\Repository | The cache repository implementation. | |
$events | Illuminate\Contracts\Events\Dispatcher | The event dispatcher instance. | |
$exceptions | Illuminate\Foundation\Exceptions\Handler | The exception handler instance. | |
$manager | Illuminate\Queue\QueueManager | The queue manager instance. |
Method | Description | |
---|---|---|
__construct ( Illuminate\Queue\QueueManager $manager, Illuminate\Contracts\Events\Dispatcher $events, Illuminate\Contracts\Debug\ExceptionHandler $exceptions ) : void | Create a new queue worker. | |
daemon ( string $connectionName, string $queue, |
Listen to the given queue in a loop. | |
getManager ( ) : Illuminate\Queue\QueueManager | Get the queue manager instance. | |
memoryExceeded ( integer $memoryLimit ) : boolean | Determine if the memory limit has been exceeded. | |
process ( string $connectionName, Illuminate\Contracts\Queue\Job $job, |
Process a given job from the queue. | |
runNextJob ( string $connectionName, string $queue, |
Process the next job on the queue. | |
setCache ( Illuminate\Contracts\Cache\Repository $cache ) : void | Set the cache repository implementation. | |
setManager ( Illuminate\Queue\QueueManager $manager ) : void | Set the queue manager instance. | |
sleep ( integer $seconds ) : void | Sleep the script for a given number of seconds. | |
stop ( ) : void | Stop listening and bail out of the script. |
Method | Description | |
---|---|---|
daemonShouldRun ( |
Determine if the daemon should process on this iteration. | |
failJob ( string $connectionName, Illuminate\Contracts\Queue\Job $job, Exception $e ) : void | Mark the given job as failed and raise the relevant event. | |
getNextJob ( Illuminate\Contracts\Queue\Queue $connection, string $queue ) : Illuminate\Contracts\Queue\Job | null | Get the next job from the queue connection. | |
getTimestampOfLastQueueRestart ( ) : integer | null | Get the last queue restart timestamp, or null. | |
handleJobException ( string $connectionName, Illuminate\Contracts\Queue\Job $job, |
Handle an exception that occurred while the job was running. | |
markJobAsFailedIfAlreadyExceedsMaxAttempts ( string $connectionName, Illuminate\Contracts\Queue\Job $job, integer $maxTries ) : void | Mark the given job as failed if it has exceeded the maximum allowed attempts. | |
markJobAsFailedIfHasExceededMaxAttempts ( string $connectionName, Illuminate\Contracts\Queue\Job $job, integer $maxTries, Exception $e ) : void | Mark the given job as failed if it has exceeded the maximum allowed attempts. | |
queueShouldRestart ( integer | null $lastRestart ) : boolean | Determine if the queue worker should restart. | |
raiseAfterJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job ) : void | Raise the after queue job event. | |
raiseBeforeJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job ) : void | Raise the before queue job event. | |
raiseExceptionOccurredJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job, Exception $e ) : void | Raise the exception occurred queue job event. | |
raiseFailedJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job, Exception $e ) : void | Raise the failed queue job event. | |
registerTimeoutHandler ( Illuminate\Contracts\Queue\Job | null $job, |
Register the worker timeout handler (PHP 7.1+). | |
runJob ( Illuminate\Contracts\Queue\Job $job, string $connectionName, |
Process the given job. |
public __construct ( Illuminate\Queue\QueueManager $manager, Illuminate\Contracts\Events\Dispatcher $events, Illuminate\Contracts\Debug\ExceptionHandler $exceptions ) : void | ||
$manager | Illuminate\Queue\QueueManager | |
$events | Illuminate\Contracts\Events\Dispatcher | |
$exceptions | Illuminate\Contracts\Debug\ExceptionHandler | |
return | void |
protected daemonShouldRun ( |
||
$options | ||
return | boolean |
public getManager ( ) : Illuminate\Queue\QueueManager | ||
return | Illuminate\Queue\QueueManager |
protected getNextJob ( Illuminate\Contracts\Queue\Queue $connection, string $queue ) : Illuminate\Contracts\Queue\Job | null | ||
$connection | Illuminate\Contracts\Queue\Queue | |
$queue | string | |
return | Illuminate\Contracts\Queue\Job | null |
protected getTimestampOfLastQueueRestart ( ) : integer | null | ||
return | integer | null |
protected handleJobException ( string $connectionName, Illuminate\Contracts\Queue\Job $job, |
||
$connectionName | string | |
$job | Illuminate\Contracts\Queue\Job | |
$options | ||
$e | Exception | |
return | void |
public memoryExceeded ( integer $memoryLimit ) : boolean | ||
$memoryLimit | integer | |
return | boolean |
protected raiseAfterJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job ) : void | ||
$connectionName | string | |
$job | Illuminate\Contracts\Queue\Job | |
return | void |
protected raiseBeforeJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job ) : void | ||
$connectionName | string | |
$job | Illuminate\Contracts\Queue\Job | |
return | void |
protected raiseExceptionOccurredJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job, Exception $e ) : void | ||
$connectionName | string | |
$job | Illuminate\Contracts\Queue\Job | |
$e | Exception | |
return | void |
protected raiseFailedJobEvent ( string $connectionName, Illuminate\Contracts\Queue\Job $job, Exception $e ) : void | ||
$connectionName | string | |
$job | Illuminate\Contracts\Queue\Job | |
$e | Exception | |
return | void |
protected registerTimeoutHandler ( Illuminate\Contracts\Queue\Job | null $job, |
||
$job | Illuminate\Contracts\Queue\Job | null | |
$options | ||
return | void |
public setManager ( Illuminate\Queue\QueueManager $manager ) : void | ||
$manager | Illuminate\Queue\QueueManager | |
return | void |
protected Repository,Illuminate\Contracts\Cache $cache | ||
return | Illuminate\Contracts\Cache\Repository |
protected Dispatcher,Illuminate\Contracts\Events $events | ||
return | Illuminate\Contracts\Events\Dispatcher |
protected Handler,Illuminate\Foundation\Exceptions $exceptions | ||
return | Illuminate\Foundation\Exceptions\Handler |