Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
<?php Swoole\Server->on('AfterReload', Callable $callback)
The event callback name.
Callable event function.
If success, it returns true
, otherwise it returns false
.
Execute the callback function after the server reloads included files gracefully. Swoole can automatically reload any included files inside worker processes so that code changes can take place without interrupting server requests. This event is triggered after all worker process have been reloaded, read more about how to setup hot code reloading here.
This callback is triggered inside the manager process.
Since version 4.5.0
<?php
$server->on('AfterReload', function(Swoole\Server $server)
{
// ...
});