@param $job

@return \Illuminate\Http\JsonResponse
490931
public function delete(int $job)
    {
        try {
            $instance = $this->pheanstalk->peek(new JobId($job));

            $this->pheanstalk->delete($instance);

            return response()->json([
                'status' => 'success',
                'message' => 'Successfully deleted Job',
            ]);
        } catch (ServerException $e) {
            return response()->json([
                'status' => 'error',
                'message' => $e->getMessage(),
            ]);
        }
    }
1029234
public function workingOn(Resque_Job $job)
	{
		$job->worker = $this;
		$this->currentJob = $job;
		$job->updateStatus(Resque_Job_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);
	}
1215659
protected function markJobAsReserved($job)
    {
        $this->database->table($this->table)->where('id', $job->id)->update([
            'reserved_at' => $job->touch(),
            'attempts' => $job->increment(),
        ]);

        return $job;
    }
807998
protected function createClosurePayload( $job, $data )
	{
		$closure = $this->getEncrypter()->encrypt( ( new Serializer )->serialize( $job ) );

		return ['job' => 'IlluminateQueueClosure', 'data' => compact( 'closure' )];
	}
1287895
protected function doJob(AbstractJob $job)
    {
        $this->validateJobParams($job);

        $resultData = SmsWorker::buildResultDataDefault(__NAMESPACE__);

        try {
            $response = $this->send($job);

            $resultData[SmsWorker::P_RESULT_DATA_SUCCESS] = count($response['errors']) == 0;
            $resultData[SmsWorker::P_RESULT_DATA_VENDOR_ID] = $response['vendor_id'];
            $resultData[SmsWorker::P_RESULT_DATA_ERRORS] = $response['errors'];

            $job->addDebug(['vendor_response' => $response]);

        } catch (\Exception $ex) {
            $job->addDebug(['exception' => $ex->getMessage()]);
            throw new ResultException(ResultException::ERROR_TRANSPORT);
        }


        if (false === $resultData[SmsWorker::P_RESULT_DATA_SUCCESS]) {

            if (!$job->isSync()) {
                // redirect result for new root gateway class
                $gatewayClass = static::getConfig(SmsWorker::GATEWAY_DISPATCH_CLASS);
                $job->addDebug(['set_gateway' => $gatewayClass]);
                $job->setWorkerClass($gatewayClass)->save();
                throw new ResultException(ResultException::RETRY_GATEWAY_DISPATCH_CLASS);
            }

            throw new ResultException(ResultException::R_FAILURE, $resultData);
        }

        throw new ResultException(ResultException::R_SUCCESS, $resultData);
    }
277657
public function loadApplicationsForJob($job)
    {
        return $this->createQueryBuilder()
                    ->field("job")->equals(new \MongoId($job->getId()))
                    ->getQuery()
                    ->execute();
    }
977745
protected function createObjectPayload($job, $data)
    {
        $commandName = get_class($job);

        $command = serialize(clone $job);

        return array(
            'job'  => 'Nova\Queue\CallQueuedHandler@call',

            'data' => compact('commandName', 'command'),
        );
    }
743400
public function setJob(JobInterface $job)
    {
        $this->job = $job;
        
        $this->getRefs()->setJob($job);
        
        return $this;
    }
985105
public function resolveLegacyName($job)
    {
        try {
            $payload = json_decode($job->getRawBody(), true);
            $name = $payload['job'];

            if (! empty($payload['displayName'])) {
                return $payload['displayName'];
            }

            if ($name === 'Illuminate\Queue\CallQueuedHandler@call') {
                return get_class(unserialize($data['data']['command']));
            }

            if ($name === 'Illuminate\Events\CallQueuedHandler@call') {
                return $payload['data']['class'].'@'.$payload['data']['method'];
            }
        } catch (Exception $e) {
            $this->eye->logger()->error('Unable to resolve Legacy Name', $e);
            $name = 'Unknown';
        }

        return $name;
    }
746334
public function update(JobRequest $request, Job $job)
    {
        try {
            $attributes = $request->all();

            $job->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('career::job.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('career/job/' . $job->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('career/job/' . $job->getRouteKey()))
                ->redirect();
        }

    }
612690
public function serialize(Job $job): array
    {
        $this->ensureReflectorsInitialized();

        return [
            'id' => $job->getId()->__toString(),
            'name' => $this->jobPropertyReflectors['name']->getValue($job),
            'arguments' => \json_encode($this->jobPropertyReflectors['arguments']->getValue($job)),
            'max_retries' => $this->jobPropertyReflectors['maxRetries']->getValue($job),
            'retries' => $this->jobPropertyReflectors['retries']->getValue($job),
        ];
    }
447042
public function put($job)
    {
        $job['id'] = $this->redis->incr("job_id_sequence");
        $this->redis->lpush("job_queue", serialize($job));
        return $job['id'];
    }
664755
public function getJobInfo($Job) : void
    {
        $uptimeSeconds = time() - $this->startupTime;
        $uptimeSeconds = ($uptimeSeconds === 0) ? 1 : $uptimeSeconds;
        $avgJobsMin = $this->jobsTotal / ($uptimeSeconds / 60);
        $avgJobsMin = round($avgJobsMin, 2);
        $response = [
            'jobs_total' => $this->jobsTotal,
            'avg_jobs_min' => $avgJobsMin,
            'uptime_seconds' => $uptimeSeconds,
        ];
        $Job->sendData(json_encode($response));
    }
1208990
public function getJobRetryDelay($job)
    {
        if (! method_exists($job, 'retryAfter') && ! isset($job->retryAfter)) {
            return;
        }

        $delay = $job->retryAfter ?? $job->retryAfter();

        return $delay instanceof DateTimeInterface
                        ? $this->secondsUntil($delay) : $delay;
    }
748865
public function getJobStatus($job)
    {
        $jobId = Utilities::getEntityId(
            $job,
            'WindowsAzure\MediaServices\Models\Job'
        );
        $jobIdEncoded = urlencode($jobId);

        $method = Resources::HTTP_GET;
        $headers = [];
        $postParams = [];
        $queryParams = [];
        $path = "Jobs('{$jobIdEncoded}')/State";
        $statusCode = Resources::STATUS_OK;

        $response = $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode
        );

        return strip_tags($response->getBody());
    }
346929
public function show(JobRequest $request, Job $job)
    {

        if ($job->exists) {
            $view = 'career::job.show';
        } else {
            $view = 'career::job.new';
        }

        return $this->response->title(trans('app.view') . ' ' . trans('career::job.name'))
            ->data(compact('job'))
            ->view($view, true)
            ->output();
    }
1309051
protected function createStringPayload($job, $data)
    {
        return [
            'displayName' => is_string($job) ? explode('@', $job)[0] : null,
            'job' => $job, 'maxTries' => null,
            'timeout' => null, 'data' => $data,
        ];
    }