This commit is contained in:
xl
2024-11-18 11:24:08 +08:00
parent ac629ece15
commit a5378658ee
3 changed files with 175 additions and 9 deletions
+4
View File
@@ -3,6 +3,8 @@
namespace Kiri\Server\Handler;
use Kiri;
use Kiri\Abstracts\CoordinatorManager;
use Kiri\Coordinator;
use Kiri\Core\Help;
use Kiri\Events\EventDispatch;
use Kiri\Server\Events\OnAfterWorkerStart;
@@ -63,6 +65,8 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server
$dispatch = Kiri::getDi()->get(EventDispatch::class);
$dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId));
if ($workerId < $server->setting['worker_num']) {
CoordinatorManager::utility(Coordinator::WORKER_START)->waite();
$dispatch->dispatch(new OnWorkerStart($server, $workerId));
} else {
$dispatch->dispatch(new OnTaskerStart($server, $workerId));