public function sleep($time = 0, $set = false)
    {
        if ($this->state === Generic::STATE_FINISHED) {
            return;
        }
        if ($this->state !== Generic::STATE_RUNNING) {
            $set = true;
        }

        $this->sleepTime = $time;

        if (!$set) {
            throw new RequestSleep;
        } else {
            $this->ev->del();
            $this->ev->add($this->sleepTime);
        }

        $this->state = Generic::STATE_WAITING;
    }
public function sleep($time = 0, $set = false)
    {
        if ($this->state === Generic::STATE_FINISHED) {
            return;
        }
        if ($this->state !== Generic::STATE_RUNNING) {
            $set = true;
        }

        $this->sleepTime = $time;

        if (!$set) {
            throw new RequestSleep;
        } else {
            $this->ev->del();
            $this->ev->add($this->sleepTime);
        }

        $this->state = Generic::STATE_WAITING;
    }
public function sleep ( $ time = 0 , $ set = false ) { if ( $ this -> state === Generic :: STATE_FINISHED ) { return ; } if ( $ this -> state !== Generic :: STATE_RUNNING ) { $ set = true ; } $ this -> sleepTime = $ time ; if ( ! $ set ) { throw new RequestSleep ; } else { $ this -> ev -> del ( ) ; $ this -> ev -> add ( $ this -> sleepTime ) ; } $ this -> state = Generic :: STATE_WAITING ; }
Delays the request execution for the given number of seconds

@param integer $time Time to sleep in seconds
@param boolean $set Set this parameter to true when use call it outside of Request->run() or if you don't want to interrupt execution now
@throws RequestSleep
@return void
Delays the request execution for the given number of seconds