Swoole\Server->on('ManagerStop', fn)

Declaration

<?php
Swoole\Server->on('ManagerStop', Callable $callback)

Parameters

event

The event callback name.

callback

Callable event function.

Return

success

If success, it returns true, otherwise it returns false.

Description

Execute the callback function when the Manager Process in the Server is stopped.

The callback function registered for event ManagerStop is executed in the manager process.

When this event is triggered, all worker and task worker process have already been stopped and finished running.

Example

<?php
$server->on('ManagerStop', function(Swoole\Server $server)
{
  // ...
});