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

64 lines
1.1 KiB
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 ServerBase
* @package Server\Manager
*/
class ServerBase extends Server
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
/**
* @param \Swoole\Server $server
*/
public function onStart(\Swoole\Server $server)
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
$this->runEvent(Constant::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 onShutdown(\Swoole\Server $server)
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
$this->runEvent(Constant::SHUTDOWN, null, [$server]);
2021-07-18 12:06:56 +08:00
}
2021-07-19 19:04:13 +08:00
/**
* @param \Swoole\Server $server
* @param int $src_worker_id
* @param mixed $message
*/
public function onPipeMessage(\Swoole\Server $server, int $src_worker_id, mixed $message)
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
$this->runEvent(Constant::PIPE_MESSAGE, null, [$server, $src_worker_id, $message]);
2021-07-18 12:06:56 +08:00
}
2021-07-19 19:04:13 +08:00
/**
* @param \Swoole\Server $server
*/
public function onBeforeReload(\Swoole\Server $server)
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
$this->runEvent(Constant::PIPE_MESSAGE, null, [$server]);
2021-07-18 12:06:56 +08:00
}
2021-07-19 19:04:13 +08:00
/**
* @param \Swoole\Server $server
*/
public function onAfterReload(\Swoole\Server $server)
2021-07-18 12:06:56 +08:00
{
2021-07-19 19:04:13 +08:00
$this->runEvent(Constant::PIPE_MESSAGE, null, [$server]);
2021-07-18 12:06:56 +08:00
}
}