2021-03-29 15:34:24 +08:00
|
|
|
<?php /** @noinspection PhpUnusedParameterInspection */
|
|
|
|
|
|
|
|
|
|
/** @noinspection PhpComposerExtensionStubsInspection */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace ZM\Event\SwooleEvent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Swoole\Server;
|
|
|
|
|
use ZM\Annotation\Swoole\SwooleHandler;
|
|
|
|
|
use ZM\Console\Console;
|
|
|
|
|
use ZM\Event\SwooleEvent;
|
2021-05-08 10:02:41 +08:00
|
|
|
use ZM\Framework;
|
2021-03-29 15:34:24 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class OnManagerStart
|
|
|
|
|
* @package ZM\Event\SwooleEvent
|
|
|
|
|
* @SwooleHandler("ManagerStart")
|
|
|
|
|
*/
|
|
|
|
|
class OnManagerStart implements SwooleEvent
|
|
|
|
|
{
|
|
|
|
|
public function onCall(Server $server) {
|
2021-05-08 10:02:41 +08:00
|
|
|
if (!Framework::$argv["disable-safe-exit"]) {
|
|
|
|
|
pcntl_signal(SIGINT, function () {
|
|
|
|
|
Console::verbose("Interrupted in manager!");
|
|
|
|
|
});
|
|
|
|
|
}
|
2021-03-29 15:34:24 +08:00
|
|
|
Console::verbose("进程 Manager 已启动");
|
|
|
|
|
}
|
|
|
|
|
}
|