Push a new job onto the queue after a delay.

@param  \DateTime|int  $delay
@param  string  $job
@param  mixed   $data
@param  string  $queue
@return mixed
351682
public function later($delay, $job, $data = '', $queue = null)
    {
        $payload = $this->createPayload($job, $data);

        $delay = $this->getSeconds($delay);

        $this->getConnection()->zAdd($this->getQueue($queue) . ':delayed', $this->getTime() + $delay, $payload);

        return Arr::get(json_decode($payload, true), 'id');
    }
302079
public function push($job, $data = '', $queue = null)
    {
        $queueJob = $this->resolveJob($this->createPayload($job, $queue, $data), $queue);

        try {
            $this->raiseBeforeJobEvent($queueJob);

            $queueJob->fire();

            $this->raiseAfterJobEvent($queueJob);
        } catch (Exception $e) {
            $this->handleException($queueJob, $e);
        } catch (Throwable $e) {
            $this->handleException($queueJob, new FatalThrowableError($e));
        }

        return 0;
    }
820714
public function push($job, $data = '', $queue = null)
    {
        $queueJob = $this->resolveJob($this->createPayload($job, $data, $queue), $queue);

        $queueJob->handle();

        return 0;
    }
472284
public function push($job, $data = '', $queue = null)
	{
		$queueJob = $this->resolveJob($this->createPayload($job, $data, $queue));

		try
		{
			$queueJob->fire();
		}
		catch(Exception $e)
		{
			$this->handleFailedJob($queueJob);

			throw $e;
		}

		return 0;
	}
1192808
public function handleQueuedMessage(Job $job, $data)
    {
        $this->send($data['view'], $data['data'], $this->getQueuedCallable($data));

        $job->delete();
    }
121051
public function call(Job $job, array $data)
    {
        try {
            $command = $this->setJobInstanceIfNecessary(
                $job, unserialize($data['command'])
            );
        } catch (ModelNotFoundException $e) {
            return $this->handleModelNotFound($job, $e);
        }

        $this->dispatcher->dispatchNow(
            $command, $this->resolveHandler($job, $command)
        );

        if (! $job->hasFailed() && ! $job->isReleased()) {
            $this->ensureNextJobInChainIsDispatched($command);
        }

        if (! $job->isDeletedOrReleased()) {
            $job->delete();
        }
    }
511640
def delay_job(self, job, delayed_until):
        
        timestamp = datetime_to_score(delayed_until)
        self.delayed.zadd(timestamp, job.ident)
567438
public function deleteAndRelease($queue, $job, $delay)
    {
        $queue = $this->getQueue($queue);

        $reserved = $job->getReservedJob();

        $this->redis->zRem($queue . ':reserved', $reserved);

        $this->redis->zAdd($queue . ':delayed', $this->availableAt($delay), $reserved);
    }
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();
        }
    }
847726
public function release(Job $job, int $delay)
    {
        $result = false;
        $delay = $delay < 1 ? 1 : $delay;
        try {
            $res = $this->_queue->changeMessageVisibility($job->getInstance()->getReceiptHandle(), $delay);
            $result = $res->isSucceed();
        } catch (\Exception $e) {
            $this->eventsManager->fire('listener:logger', $this, '释放Queue消息失败：' . $e->getMessage());
        } finally {
            return $result;
        }
    }
72948
protected function createPayload($job, $data = '', $queue = null)
	{
		if ($job instanceof Closure)
		{
			return json_encode($this->createClosurePayload($job, $data));
		}
		elseif (is_object($job))
		{
			return json_encode([
				'job' => 'Illuminate\Queue\CallQueuedHandler@call',
				'data' => ['command' => serialize(clone $job)],
			]);
		}

		return json_encode($this->createPlainPayload($job, $data));
	}
1105790
protected function pushToDatabase($delay, $queue, $payload, $attempts = 0)
    {
        $attributes = $this->buildDatabaseRecord(
            $this->getQueue($queue), $payload, $this->getAvailableAt($delay), $attempts
        );

        return $this->database->table($this->table)->insertGetId($attributes);
    }
602240
public function release($delay = 0)
    {
        parent::release($delay);

        $this->delete();

        return $this->database->release($this->queue, $this->job, $delay);
    }
398334
protected function pushToDatabase($delay, $queue, $payload, $attempts = 0)
	{
		$availableAt = $delay instanceof DateTime ? $delay : Carbon::now()->addSeconds($delay);

		return $this->database->table($this->table)->insertGetId([
			'queue' => $this->getQueue($queue),
			'payload' => $payload,
			'attempts' => $attempts,
			'reserved' => 0,
			'reserved_at' => null,
			'available_at' => $availableAt->getTimestamp(),
			'created_at' => $this->getTime(),
		]);
	}
1237934
public function recreate($payload, $queue, $delay)
    {
        $options = ['delay' => $this->secondsUntil($delay)];

        return $this->pushRaw($payload, $queue, $options);
    }
268763
protected function createPayloadArray($job, $queue, $data = '')
    {
        return array_merge(parent::createPayloadArray($job, $queue, $data), [
            'queue' => $this->getQueue($queue),
        ]);
    }
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'),
        );
    }