Join 4,000+ others and never miss out on new tips, tutorials, and more.
pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5
The event callback name.
Callable event function.
If success, it returns
true, otherwise it returns
Execute the callback function when the Manager Process in the Server is started.
The callback function registered for the event
ManagerStart is executed in the manager process.
You can alter the name of this process within the callback function and you may use the server
sendMessage function to communicate with other worker processes.
At this stage when this callback is executed, all worker and task worker processes have been started but the status of the Master process is still unknown because both the Master and Manager threads are executed concurrently, so either one could complete at the same time.
If running a server using
OpenSwoole\Server::SIMPLE_MODE mode and if
task_worker_num configuration parameters have been set, OpenSwoole will create the manager processes to act as worker processes, which in return will trigger the
ManagerStop server events, it is more recommended to use
$server->on('ManagerStart', function(OpenSwoole\Server $server)