Преглед изворни кода

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