This commit is contained in:
2021-07-19 19:04:13 +08:00
parent 5aa94c1a25
commit b369e5c492
21 changed files with 952 additions and 616 deletions
+36 -11
View File
@@ -2,37 +2,62 @@
namespace Server\Manager;
class ServerBase
use Server\Abstracts\Server;
use Server\Constant;
/**
* Class ServerBase
* @package Server\Manager
*/
class ServerBase extends Server
{
public function onStart()
/**
* @param \Swoole\Server $server
*/
public function onStart(\Swoole\Server $server)
{
var_dump(func_get_args());
$this->runEvent(Constant::START, null, [$server]);
}
public function onShutdown()
/**
* @param \Swoole\Server $server
*/
public function onShutdown(\Swoole\Server $server)
{
var_dump(func_get_args());
$this->runEvent(Constant::SHUTDOWN, null, [$server]);
}
public function onPipeMessage()
/**
* @param \Swoole\Server $server
* @param int $src_worker_id
* @param mixed $message
*/
public function onPipeMessage(\Swoole\Server $server, int $src_worker_id, mixed $message)
{
$this->runEvent(Constant::PIPE_MESSAGE, null, [$server, $src_worker_id, $message]);
}
public function onBeforeReload()
/**
* @param \Swoole\Server $server
*/
public function onBeforeReload(\Swoole\Server $server)
{
$this->runEvent(Constant::PIPE_MESSAGE, null, [$server]);
}
public function onAfterReload()
/**
* @param \Swoole\Server $server
*/
public function onAfterReload(\Swoole\Server $server)
{
$this->runEvent(Constant::PIPE_MESSAGE, null, [$server]);
}
}