소스 검색

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