What is the relationship between onworkerstart and addprocess in easyswoole?

           $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;$iPP){
               ServerManager::getInstance()->getSwooleServer()->addProcess((new Consumer("consumer_{$i}"))->getProcess());
           }

what is the relationship between them

what is the relationship between onworkerstart and addprocess

when onworkerstart is enabled, 8 worker can be displayed
clipboard.png
of which 4 worker_num and 4 task_worker_num

MAIN_SERVER.SETTING.worker_num = 4
MAIN_SERVER.SETTING.max_request = 5000
MAIN_SERVER.SETTING.task_worker_num = 4

what is the relationship between the added process and the worker?

Php
Apr.17,2022

although the custom process is hosted to the Manager process, it is a more independent process than worker and performs custom functions. OnWorkerStart is executed only when the
worker process and the task process start, so you see 8 outputs

onWorkerStart
addProcess

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9bc9b-47665.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9bc9b-47665.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?