We wrap the standard job processor, and add our tracking code around it.

@param  string  $connectionName
@param  \Illuminate\Contracts\Queue\Job  $job
@param  \Illuminate\Queue\WorkerOptions  $options
@return void

@throws \Throwable
768638
public function process($connectionName, $job, WorkerOptions $options)
    {
        $startTime = microtime(true);

        try {
            parent::process($connectionName, $job, $options);
        } catch (Exception $e) {
            $this->recordJobException($e);
        } catch (Throwable $e) {
            $this->recordJobException($e);
        } finally {
            $this->recordJobEnd($startTime, $job->resolveName());
        }
    }
108104
public function runNextJob($queue, WorkerOptions $options)
    {
        try {
            $job = $this->getNextJob($queue);
            if ($job) {
                return $this->process(
                    $job,
                    $options
                );
            }
            return false;
        } catch (Exception $e) {
            $this->reportExceptions($e);
        }
    }
1240693
protected function timeoutForJob($job, WorkerOptions $options)
    {
        return $job && ! is_null($job->timeout()) ? $job->timeout() : $options->timeout;
    }
647398
private static function setConnectionCollation(Connection $connection, array $options = array())
    {
        if (isset($options['collation'])) {
            try {
                if ('pdo_mysql' === $connection->getDriver()->getName()) {
                    $connection->executeQuery('SET SESSION collation_connection = "'.addslashes($options['collation']).'";');
                }
            } catch (\Exception $e) {
                throw new InvalidArgumentException(
                    sprintf('Invalid database collation `%s`', $options['collation']),
                    InvalidArgumentException::INVALID_ARGUMENT,
                    $e
                );
            }
        }
    }
1245086
public function workingOn(Job $job)
    {
        $job->worker = $this;
        $this->currentJob = $job;
        $job->updateStatus(Status::STATUS_RUNNING);
        $data = json_encode(array(
            'queue' => $job->queue,
            'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'),
            'payload' => $job->payload
        ));
        Resque::redis()->set('worker:' . $job->worker, $data);
    }
193211
public function runNextJob($connectorName, $queue, $delay = 0, $sleep = 3, $maxTries = 0)
    {

        $job = $this->getNextJob($this->queue->driver($connectorName), $queue);

        if (!$job) {
            $this->runJob($job, $connectorName, $maxTries, $delay);
            return;
        }

        $this->sleep($sleep);
    }
1190005
public function runNextJob(ListenerOptions $options)
    {
        $job = $this->getNextJob($options);

        // If we're able to pull a job off of the stack, we will process it and then return
        // from this method. If there is no job on the queue, we will "sleep" the worker
        // for the specified number of seconds, then keep processing jobs after sleep.
        if ($job) {
            return $this->runJob($job, $options);
        }

        $this->sleep($options->sleep);
    }
725721
protected function timeoutForJob(Job $job, ListenerOptions $options)
    {
        return $job && !is_null($job->timeout()) ? $job->timeout() : $options->timeout;
    }
280887
private static function setConnectionCharset(Connection $connection, array $options = array())
    {
        if (isset($options['charset'])) {
            try {
                if ('pdo_mysql' === $connection->getDriver()->getName()) {
                    $connection->executeQuery('SET SESSION character_set_client = "'.addslashes($options['charset']).'";');
                    $connection->executeQuery('SET SESSION character_set_connection = "'.addslashes($options['charset']).'";');
                    $connection->executeQuery('SET SESSION character_set_results = "'.addslashes($options['charset']).'";');
                }
            } catch (\Exception $e) {
                throw new InvalidArgumentException(
                    sprintf('Invalid database character set `%s`', $options['charset']),
                    InvalidArgumentException::INVALID_ARGUMENT,
                    $e
                );
            }
        }
    }
9969
protected function raiseAfterJobEvent($connection, Job $job)
    {
        if (isset($this->events)) {
            $this->events->dispatch('nova.queue.processed', array($connection, $job));
        }
    }
617880
public function enqueue(Job $job): void
    {
        $queue = $job->getQueue();

        $this->client->sadd('queue', [$queue]);

        $this->client->rpush(
            sprintf('queue:%s', $queue),
            [
                json_encode($job->getPayload()),
            ]
        );
    }
152349
protected function raiseExceptionOccurredJobEvent( $connection, Job $job, $exception )
	{
		$data = json_decode( $job->getRawBody(), true );
		Framework::hooks()->trigger( 'queue.job.exception', compact( 'connection', 'job', 'data', 'exception' ) );
	}
1326697
protected function runNextJobForDaemon($connectionName, $queue, $delay, $sleep, $maxTries)
	{
		try
		{
			$this->pop($connectionName, $queue, $delay, $sleep, $maxTries);
		}
		catch (Exception $e)
		{
			if ($this->exceptions) $this->exceptions->report($e);
		}
	}
620306
public function call(Job $job, array $data)
    {
        $handler = $this->setJobInstanceIfNecessary(
            $job, $this->container->make($data['class'])
        );

        call_user_func_array(
            array($handler, $data['method']), unserialize($data['data'])
        );

        if (! $job->isDeletedOrReleased()) {
            $job->delete();
        }
    }
888034
protected function raiseBeforeJobEvent( $connection, Job $job )
	{
		$data = json_decode( $job->getRawBody(), true );
		Framework::hooks()->trigger( 'queue.job.processing', compact( 'connection', 'job', 'data' ) );
	}
895858
public function executeJob(Job $job, int $retryLimit = 0): void
    {
        // This is here so that if executeJob is called with out startBatch the events will still be called
        $this->triggerBatchEvents = !$this->batchStarted;
        if ($this->triggerBatchEvents) {
            $this->startBatch(new JobBatch([$job]));
        }

        $internal = false;

        if ($this->logger) {
            $this->logger->debug('Start a job.', [
                'name' => $job->getName(),
                'arguments' => $job->getArguments(),
            ]);
        }

        try {
            $worker = $this->workersMap->get($job->getName());
            if (!$worker instanceof Worker) {
                throw new InvalidWorkerException("The worker {$job->getName()} is not an instance of ".Worker::class);
            }
            $internal = $worker instanceof InternalWorker;
            if ($this->eventDispatcher) {
                $this->eventDispatcher->dispatch(self::JOB_START_EVENT, new StartJobEvent($job, $internal));
            }
            $worker->execute($job->getArguments());
        } catch (NotFoundExceptionInterface $e) {
            $unrecoverable = new UnrecoverableJobException("Missing worker {$job->getName()}", 0, $e);
            $this->failedJob($job, $unrecoverable, $internal);

            throw $unrecoverable;
        } catch (UnrecoverableJobExceptionInterface $e) {
            $this->failedJob($job, $e, $internal);

            throw $e;
        } catch (\Throwable $e) {
            if (!$job instanceof RetryableJob) {
                $unrecoverable = new UnrecoverableJobException('Job failed and is not retryable', 0, $e);
                $this->failedJob($job, $unrecoverable, $internal);

                throw $unrecoverable;
            }

            if ($job->getRetryCount() >= $retryLimit) {
                $unrecoverable = new UnrecoverableJobException('Job reached retry limit and won\'t be retried again', 0, $e);
                $this->failedJob($job, $unrecoverable, $internal);

                throw $unrecoverable;
            }

            $this->failedJob($job, $e, $internal);

            throw $e;
        }
        $this->finishJob($job, $internal);
    }
991204
protected function runJob(Job $job, ListenerOptions $options)
    {
        try {
            $this->process($job, $options);
        } catch (Exception $e) {
            $this->exceptions->report($e);
        } catch (Throwable $e) {
            $this->exceptions->report(new FatalThrowableError($e));
        }
    }