Resque\Queue::later PHP Метод

later() публичный Метод

Queue a job for later retrieval. Jobs are unique per queue and are deleted upon retrieval. If a given job (payload) already exists, it is updated with the new delay.
public later ( integer $delay, string $job, array $data = [], string $queue = null ) : Job
$delay integer This can be number of seconds or unix timestamp
$job string The job class
$data array The job data
$queue string The queue to add the job to
Результат Job job instance
    public function later($delay, $job, array $data = array(), $queue = null)
    {
        // If it's a datetime object conver to unix time
        if ($delay instanceof \DateTime) {
            $delay = $delay->getTimestamp();
        }
        if (!is_numeric($delay)) {
            throw new \InvalidArgumentException('The delay "' . $delay . '" must be an integer or DateTime object.');
        }
        // If the delay is smaller than 3 years then assume that an interval
        // has been passed i.e. 600 seconds, otherwise it's a unix timestamp
        if ($delay < 94608000) {
            $delay += time();
        }
        return Job::create($this->getQueue($queue), $job, $data, $delay);
    }