This commit is contained in:
2020-09-02 17:33:48 +08:00
parent f64942424b
commit 5fa97ded93
10 changed files with 147 additions and 68 deletions
+20 -2
View File
@@ -4,15 +4,33 @@
namespace HttpServer\Events;
use Exception;
use HttpServer\Events\Abstracts\Callback;
use Snowflake\Event;
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
use Swoole\Server;
/**
* Class OnAfterReload
* @package HttpServer\Events
*/
class OnAfterReload extends Callback
{
public function onHandler()
/**
* @param Server $server
* @throws ComponentException
* @throws Exception
*/
public function onHandler(Server $server)
{
// TODO: Implement onHandler() method.
$event = Snowflake::get()->getEvent();
if (!$event->exists(Event::SERVER_AFTER_RELOAD)) {
return;
}
$event->trigger(Event::SERVER_AFTER_RELOAD, [$server]);
}
}