Эх сурвалжийг харах

Merge pull request #503 from blogdaren/master

support reloading all worker instances gracefully when new start scripts added
walkor 6 жил өмнө
parent
commit
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