$register->add($register::onWorkerStart, function (\swoole_server $server, int $workerId) {
var_dump('worker:' . $workerId . 'start');
});
Di::getInstance()->set("REDIS",Redis::getInstance());
$allNum = 10; for ($i = 0 ;$i < $allNum;$i++){
ServerManager::getInstance()->getSwooleServer()->addProcess((new Consumer("consumer_{$i}"))->getProcess());
}他们之间是什么关系onworkerstart和addprocess 是什么关系呢onworkerstart 开启后可以显示8个worker 其中4个worker_num和4个task_worker_numMAIN_SERVER.SETTING.worker_num = 4
MAIN_SERVER.SETTING.max_request = 5000
MAIN_SERVER.SETTING.task_worker_num = 4添加的进程跟这个worker之间是什么关系呢 ?
1 回答
- 1 回答
- 0 关注
- 953 浏览
添加回答
举报
0/150
提交
取消