This commit is contained in:
2020-09-02 11:38:47 +08:00
parent 3e46f5790f
commit 8397c2ac8a
46 changed files with 1021 additions and 824 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace HttpServer\Events;
use HttpServer\Events\Abstracts\Callback;
use Snowflake\Event;
use Snowflake\Snowflake;
use Swoole\Server;
/**
* Class OnManagerStop
* @package HttpServer\Events
*/
class OnManagerStop extends Callback
{
/**
* @param $server
* @throws \Exception
*/
public function onHandler(Server $server)
{
$this->warning('manager stop.');
$events = Snowflake::get()->event;
if ($events->exists(Event::SERVER_MANAGER_STOP)) {
$events->trigger(Event::SERVER_MANAGER_STOP, [$server]);
}
// $runPath = storage(null, 'workerIds');
// foreach (glob($runPath . '/*') as $item) {
// if (!file_exists($item)) {
// continue;
// }
// @unlink($item);
// }
}
}