Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function dispatch(bool $blocking)
 {
     $flags = \Ev::RUN_ONCE;
     if (!$blocking) {
         $flags |= \Ev::RUN_NOWAIT;
     }
     $this->loop->run($flags);
     // Dispatch I/O, timer, and signal callbacks.
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function dispatch(int $level)
 {
     if ($this->deferred || $this->enable || $this->running <= $level) {
         $this->loop->run(\Ev::RUN_ONCE | \Ev::RUN_NOWAIT);
     } else {
         $this->loop->run(\Ev::RUN_ONCE);
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function run()
 {
     $this->running = true;
     while ($this->running) {
         $this->nextTickQueue->tick();
         $this->futureTickQueue->tick();
         $flags = \Ev::RUN_ONCE;
         if (!$this->running || !$this->nextTickQueue->isEmpty() || !$this->futureTickQueue->isEmpty()) {
             $flags |= \Ev::RUN_NOWAIT;
         } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count()) {
             break;
         }
         $this->loop->run($flags);
     }
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 protected function dispatch($blocking)
 {
     $this->handle->run($blocking ? \Ev::RUN_ONCE : \Ev::RUN_ONCE | \Ev::RUN_NOWAIT);
 }