public function queue()
    {
        if (Event::fire(Event::JOB_QUEUE, $this) === false) {
            return false;
        }

        $this->redis->sadd(Queue::redisKey(), $this->queue);
        $status = $this->redis->rpush(Queue::redisKey($this->queue), $this->payload);

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

        $this->setStatus(self::STATUS_WAITING);

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

        Event::fire(Event::JOB_QUEUED, $this);

        return true;
    }
public function queue()
    {
        if (Event::fire(Event::JOB_QUEUE, $this) === false) {
            return false;
        }

        $this->redis->sadd(Queue::redisKey(), $this->queue);
        $status = $this->redis->rpush(Queue::redisKey($this->queue), $this->payload);

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

        $this->setStatus(self::STATUS_WAITING);

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

        Event::fire(Event::JOB_QUEUED, $this);

        return true;
    }
public function queue ( ) { if ( Event :: fire ( Event :: JOB_QUEUE , $ this ) === false ) { return false ; } $ this -> redis -> sadd ( Queue :: redisKey ( ) , $ this -> queue ) ; $ status = $ this -> redis -> rpush ( Queue :: redisKey ( $ this -> queue ) , $ this -> payload ) ; if ( $ status < 1 ) { return false ; } $ this -> setStatus ( self :: STATUS_WAITING ) ; Stats :: incr ( 'queued' , 1 ) ; Stats :: incr ( 'queued' , 1 , Queue :: redisKey ( $ this -> queue , 'stats' ) ) ; Event :: fire ( Event :: JOB_QUEUED , $ this ) ; return true ; }
Save the job to Redis queue

@return bool success
Save the job to Redis queue