Files
kiri-core/HttpServer/Events/OnShutdown.php
T

35 lines
540 B
PHP
Raw Normal View History

2020-09-02 11:38:47 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-09-02 11:38:47 +08:00
namespace HttpServer\Events;
use Exception;
2020-09-04 01:05:33 +08:00
use HttpServer\Abstracts\Callback;
2020-09-02 11:38:47 +08:00
use Snowflake\Event;
2020-09-02 17:33:48 +08:00
use Snowflake\Exception\ComponentException;
2020-09-02 11:38:47 +08:00
use Snowflake\Snowflake;
use Swoole\Server;
/**
* Class OnShutdown
* @package HttpServer\Events
*/
class OnShutdown extends Callback
{
/**
* @param Server $server
2020-09-02 17:33:48 +08:00
* @throws Exception
2020-09-02 11:38:47 +08:00
*/
public function onHandler(Server $server)
{
2020-10-21 15:50:43 +08:00
$this->debug('server shutdown~');
2020-10-21 15:55:56 +08:00
2021-03-09 19:43:14 +08:00
$this->system_mail('server shutdown~');
fire(Event::SERVER_SHUTDOWN);
2020-09-02 11:38:47 +08:00
}
}