public function delay($time)
    {
        if (Event::fire(Event::JOB_DELAY, array($this, $time)) === false) {
            return false;
        }

        $this->redis->sadd(Queue::redisKey(), $this->queue);
        $status = $this->redis->zadd(Queue::redisKey($this->queue, 'delayed'), $time, $this->payload);

        if ($status < 1) {
            return false;
        }

        $this->setStatus(self::STATUS_DELAYED);
        $this->redis->hset(self::redisKey($this), 'delayed', $time);

        Stats::incr('delayed', 1);
        Stats::incr('delayed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_DELAYED, array($this, $time));

        return true;
    }
public function delay($time)
    {
        if (Event::fire(Event::JOB_DELAY, array($this, $time)) === false) {
            return false;
        }

        $this->redis->sadd(Queue::redisKey(), $this->queue);
        $status = $this->redis->zadd(Queue::redisKey($this->queue, 'delayed'), $time, $this->payload);

        if ($status < 1) {
            return false;
        }

        $this->setStatus(self::STATUS_DELAYED);
        $this->redis->hset(self::redisKey($this), 'delayed', $time);

        Stats::incr('delayed', 1);
        Stats::incr('delayed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_DELAYED, array($this, $time));

        return true;
    }
public function delay ( $ time ) { if ( Event :: fire ( Event :: JOB_DELAY , array ( $ this , $ time ) ) === false ) { return false ; } $ this -> redis -> sadd ( Queue :: redisKey ( ) , $ this -> queue ) ; $ status = $ this -> redis -> zadd ( Queue :: redisKey ( $ this -> queue , 'delayed' ) , $ time , $ this -> payload ) ; if ( $ status < 1 ) { return false ; } $ this -> setStatus ( self :: STATUS_DELAYED ) ; $ this -> redis -> hset ( self :: redisKey ( $ this ) , 'delayed' , $ time ) ; Stats :: incr ( 'delayed' , 1 ) ; Stats :: incr ( 'delayed' , 1 , Queue :: redisKey ( $ this -> queue , 'stats' ) ) ; Event :: fire ( Event :: JOB_DELAYED , array ( $ this , $ time ) ) ; return true ; }
Save the job to Redis delayed queue

@param  int  $time unix time of when to perform job
@return bool success
Save the job to Redis delayed queue