eee
This commit is contained in:
@@ -26,14 +26,6 @@ use function config;
|
||||
class OnServerWorker extends Kiri\Server\Abstracts\Server
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var EventDispatch
|
||||
*/
|
||||
#[Container(EventDispatch::class)]
|
||||
public EventDispatch $dispatch;
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -68,13 +60,14 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server
|
||||
*/
|
||||
public function onWorkerStart(Server $server, int $workerId): void
|
||||
{
|
||||
$this->dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId));
|
||||
$dispatch = Kiri::getDi()->get(EventDispatch::class);
|
||||
$dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId));
|
||||
if ($workerId < $server->setting['worker_num']) {
|
||||
$this->dispatch->dispatch(new OnWorkerStart($server, $workerId));
|
||||
$dispatch->dispatch(new OnWorkerStart($server, $workerId));
|
||||
} else {
|
||||
$this->dispatch->dispatch(new OnTaskerStart($server, $workerId));
|
||||
$dispatch->dispatch(new OnTaskerStart($server, $workerId));
|
||||
}
|
||||
$this->dispatch->dispatch(new OnAfterWorkerStart($server, $workerId));
|
||||
$dispatch->dispatch(new OnAfterWorkerStart($server, $workerId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user