OpenSwoole\Server->on('AfterReload', fn)

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Server->on('AfterReload', 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 after the server reloads included files gracefully. OpenSwoole 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

Example

<?php
$server->on('AfterReload', function(OpenSwoole\Server $server)
{
  // ...
});
Last updated on September 1, 2022