@@ -246,6 +246,12 @@ class Select implements EventInterface
// 等待可读或者可写事件
@stream_select($read, $write, $e, 0, $this->_selectTimeout);
+ // 尝试执行定时任务
+ if(!$this->_scheduler->isEmpty())
+ {
+ $this->tick();
+ }
+
// 这些描述符可读,执行对应描述符的读回调函数
if($read)
{
@@ -271,12 +277,6 @@ class Select implements EventInterface
}
-
- // 尝试执行定时任务
- if(!$this->_scheduler->isEmpty())
- {
- $this->tick();
- }