This commit is contained in:
2021-03-29 11:32:01 +08:00
parent b70f705450
commit fe6c754857
6 changed files with 565 additions and 572 deletions
+2 -16
View File
@@ -35,7 +35,8 @@ class OnWorkerStart extends Callback
putenv('state=start');
putenv('worker=' . $worker_id);
$this->set_process_name($server, $worker_id);
name($server->worker_pid);
if ($worker_id >= $server->setting['worker_num']) {
$this->onTask($server, $worker_id);
} else {
@@ -78,19 +79,4 @@ class OnWorkerStart extends Callback
}
/**
* @param $socket
* @param $worker_id
* @throws Exception
*/
private function set_process_name($socket, $worker_id): void
{
if ($worker_id >= $socket->setting['worker_num']) {
name('Task: No.' . $worker_id);
} else {
name('Worker: No.' . $worker_id);
}
}
}