소스 검색

Merge pull request #503 from blogdaren/master

support reloading all worker instances gracefully when new start scripts added
walkor 6 년 전
부모
커밋
7f0cd2b959
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      Worker.php

+ 14 - 1
Worker.php

@@ -678,6 +678,19 @@ class Worker
         }
     }
 
+    /**  
+     * Reload all worker instances.
+     *
+     * @return void
+     */
+    public static function reloadAllWorkers()
+    {    
+        static::init();
+        static::initWorkers();
+        static::displayUI();
+        static::$_status = static::STATUS_RELOADING;
+    }    
+
     /**
      * Get all worker instances.
      *
@@ -697,7 +710,7 @@ class Worker
     {
         return static::$globalEvent;
     }
-    
+
     /**
      * Get main socket resource
      * @return resource