This commit is contained in:
2021-08-05 16:15:42 +08:00
parent dca2948371
commit 4b16d82bb9
8 changed files with 73 additions and 52 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace Server\Manager;
use Server\Abstracts\Server;
use Server\Constant;
/**
* Class OnServerManager
* @package Server\Manager
*/
class OnServerManager extends Server
{
/**
* @param \Swoole\Server $server
* @throws \Snowflake\Exception\ConfigException
*/
public function onManagerStart(\Swoole\Server $server)
{
$this->setProcessName(sprintf('manger[%d].0', $server->manager_pid));
$this->runEvent(Constant::MANAGER_START, null, [$server]);
}
/**
* @param \Swoole\Server $server
*/
public function onManagerStop(\Swoole\Server $server)
{
$this->runEvent(Constant::MANAGER_STOP, null, [$server]);
}
}