예제 #1
0
파일: Base.php 프로젝트: jmuyuyang/co-psf
 public function next()
 {
     $coroutine = $this->_coroutine;
     if ($coroutine->valid()) {
         \Coroutine::resume($coroutine);
     }
 }
예제 #2
0
파일: Base.php 프로젝트: jmuyuyang/co-psf
 public function next()
 {
     $coroutine = $this->_coroutine;
     $taskQueue = static::TASK_QUEUE;
     if ($coroutine->valid()) {
         \Coroutine::resume($coroutine);
     } else {
         //协程结束自动释放可用链接
         $this->release($this);
     }
 }
예제 #3
0
파일: Tcp.php 프로젝트: jmuyuyang/co-psf
 public function next()
 {
     if ($this->_coroutine->valid()) {
         $coValue = $this->_coroutine->current();
         if (!$coValue instanceof \Client\Tcp) {
             \Coroutine::resume($this->_coroutine);
             $this->sleep();
             //当前协程不再监听读事件,则移除读事件
         }
     }
 }
예제 #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;
         }
     }
 }