소스 검색

Fix offDelay

walkor 2 년 전
부모
커밋
43d65d7079
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      src/Events/Event.php

+ 2 - 3
src/Events/Event.php

@@ -91,9 +91,8 @@ class Event implements EventInterface
     {
         $className = $this->eventClassName;
         $timerId = $this->timerId++;
-        $event = new $className($this->eventBase, -1, $className::TIMEOUT, function () use ($func, $args, $timerId) {
+        $event = new $className($this->eventBase, -1, $className::TIMEOUT, function () use ($func, $args) {
             try {
-                $this->offDelay($timerId);
                 $func(...$args);
             } catch (\Throwable $e) {
                 Worker::stopAll(250, $e);
@@ -159,7 +158,7 @@ class Event implements EventInterface
         if (!$event || !$event->add()) {
             return false;
         }
-        $this->writeEvents[$fdKey] = $event;
+        $this->readEvents[$fdKey] = $event;
         return true;
     }