浏览代码

Update Worker.php

walkor 2 年之前
父节点
当前提交
20681c27f4
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/Worker.php

+ 4 - 1
src/Worker.php

@@ -49,7 +49,7 @@ class Worker
      *
      * @var string
      */
-    public const VERSION = '5.0.0-beta.6';
+    public const VERSION = '5.0.0-beta.7';
 
     /**
      * Status starting.
@@ -1441,6 +1441,9 @@ class Worker
 
             restore_error_handler();
 
+            // Add an empty timer to prevent the event-loop from exiting.
+            Timer::add(1000000, function (){});
+            
             // Display UI.
             static::safeEcho(str_pad($worker->name, 48) . str_pad($worker->getSocketName(), 36) . str_pad('1', 10) . "  [ok]\n");
             $worker->listen();