Illuminate\Queue\Worker::getNextJob PHP Method

getNextJob() protected method

Get the next job from the queue connection.
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 function getNextJob($connection, $queue)
    {
        try {
            foreach (explode(',', $queue) as $queue) {
                if (!is_null($job = $connection->pop($queue))) {
                    return $job;
                }
            }
        } catch (Exception $e) {
            $this->exceptions->report($e);
        } catch (Throwable $e) {
            $this->exceptions->report(new FatalThrowableError($e));
        }
    }