Exemplo n.º 1
0
 public function next()
 {
     $coroutine = $this->_coroutine;
     if ($coroutine->valid()) {
         \Coroutine::resume($coroutine);
     }
 }
Exemplo n.º 2
0
 public function next()
 {
     $coroutine = $this->_coroutine;
     $taskQueue = static::TASK_QUEUE;
     if ($coroutine->valid()) {
         \Coroutine::resume($coroutine);
     } else {
         //协程结束自动释放可用链接
         $this->release($this);
     }
 }
Exemplo n.º 3
0
 public function next()
 {
     if ($this->_coroutine->valid()) {
         $coValue = $this->_coroutine->current();
         if (!$coValue instanceof \Client\Tcp) {
             \Coroutine::resume($this->_coroutine);
             $this->sleep();
             //当前协程不再监听读事件,则移除读事件
         }
     }
 }
Exemplo n.º 4
0
 public function next()
 {
     if ($this->_coroutine->valid()) {
         $coValue = $this->_coroutine->current();
         if (!$coValue instanceof \Client\Websocket) {
             \Coroutine::resume($this->_coroutine);
             $this->sleep();
             //当前协程不再监听读事件,则移除读事件
             return false;
         } else {
             return true;
         }
     }
 }