Files
kiri-core/Server/Manager/ServerManager.php
T

38 lines
606 B
PHP
Raw Normal View History

2021-07-18 12:06:56 +08:00
<?php
namespace Server\Manager;
2021-07-19 19:04:13 +08:00
use Server\Abstracts\Server;
use Server\Constant;
/**
* Class ServerManager
* @package Server\Manager
*/
class ServerManager extends Server
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
/**
* @param \Swoole\Server $server
*/
public function onManagerStart(\Swoole\Server $server)
2021-07-18 12:06:56 +08:00
{
2021-07-26 02:58:45 +08:00
$this->setProcessName(sprintf('manger[%d].0', $server->manager_pid));
2021-07-26 02:55:55 +08:00
$this->runEvent(Constant::MANAGER_START, null, [$server]);
2021-07-18 12:06:56 +08:00
}
2021-07-19 19:04:13 +08:00
/**
* @param \Swoole\Server $server
*/
public function onManagerStop(\Swoole\Server $server)
{
$this->runEvent(Constant::MANAGER_STOP, null, [$server]);
2021-07-18 12:06:56 +08:00
}
}