|
@@ -90,37 +90,37 @@ function sub_message($channels)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-Co\run(function()
|
|
|
-{
|
|
|
- Base::run_util();
|
|
|
- set_error_handler('handle_error');
|
|
|
- go(function () {
|
|
|
- sub_message(['refill']);
|
|
|
- });
|
|
|
- $looper = new processor(true);
|
|
|
- $looper->run();
|
|
|
-});
|
|
|
-
|
|
|
-//for ($i = 0; $i < $process_count;$i++)
|
|
|
-//{
|
|
|
-// $process = new Swoole\Process(function(Swoole\Process $worker)
|
|
|
-// {
|
|
|
-// Base::run_util();
|
|
|
-// set_error_handler('handle_error');
|
|
|
-// go(function () {
|
|
|
-// sub_message(['refill']);
|
|
|
-// });
|
|
|
-//
|
|
|
-// $looper = new processor(true);
|
|
|
-// $looper->run();
|
|
|
-//
|
|
|
-// }, false, false, true);
|
|
|
-//
|
|
|
-// $process->start();
|
|
|
-//}
|
|
|
-//
|
|
|
-//for ($i = 0; $i < $process_count;$i++)
|
|
|
+//Co\run(function()
|
|
|
//{
|
|
|
-// $status = Swoole\Process::wait(true);
|
|
|
-// Log::record("Recycled #{$status['pid']}, code={$status['code']}, signal={$status['signal']}",Log::DEBUG);
|
|
|
-//}
|
|
|
+// Base::run_util();
|
|
|
+// set_error_handler('handle_error');
|
|
|
+// go(function () {
|
|
|
+// sub_message(['refill']);
|
|
|
+// });
|
|
|
+// $looper = new processor(true);
|
|
|
+// $looper->run();
|
|
|
+//});
|
|
|
+
|
|
|
+for ($i = 0; $i < $process_count;$i++)
|
|
|
+{
|
|
|
+ $process = new Swoole\Process(function(Swoole\Process $worker)
|
|
|
+ {
|
|
|
+ Base::run_util();
|
|
|
+ set_error_handler('handle_error');
|
|
|
+ go(function () {
|
|
|
+ sub_message(['refill']);
|
|
|
+ });
|
|
|
+
|
|
|
+ $looper = new processor(true);
|
|
|
+ $looper->run();
|
|
|
+
|
|
|
+ }, false, false, true);
|
|
|
+
|
|
|
+ $process->start();
|
|
|
+}
|
|
|
+
|
|
|
+for ($i = 0; $i < $process_count;$i++)
|
|
|
+{
|
|
|
+ $status = Swoole\Process::wait(true);
|
|
|
+ Log::record("Recycled #{$status['pid']}, code={$status['code']}, signal={$status['signal']}",Log::DEBUG);
|
|
|
+}
|