瀏覽代碼

timer first

walkor 10 年之前
父節點
當前提交
133201a2ff
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      Events/Select.php

+ 6 - 6
Events/Select.php

@@ -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();
-            }
         }
     }
 }