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;
    }