mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 16:15:34 +08:00
24 lines
551 B
PHP
24 lines
551 B
PHP
|
|
<?php /** @noinspection PhpUnusedParameterInspection */
|
||
|
|
|
||
|
|
|
||
|
|
namespace ZM\Event\SwooleEvent;
|
||
|
|
|
||
|
|
|
||
|
|
use Swoole\Server;
|
||
|
|
use Swoole\Timer;
|
||
|
|
use ZM\Annotation\Swoole\SwooleHandler;
|
||
|
|
use ZM\Console\Console;
|
||
|
|
use ZM\Event\SwooleEvent;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Class OnWorkerExit
|
||
|
|
* @package ZM\Event\SwooleEvent
|
||
|
|
* @SwooleHandler("WorkerExit")
|
||
|
|
*/
|
||
|
|
class OnWorkerExit implements SwooleEvent
|
||
|
|
{
|
||
|
|
public function onCall(Server $server, $worker_id) {
|
||
|
|
Timer::clearAll();
|
||
|
|
Console::info("正在结束 Worker #".$worker_id.",进程内可能有事务在运行...");
|
||
|
|
}
|
||
|
|
}
|