Revert "改名"
This reverts commit fdf58326
This commit is contained in:
@@ -12,6 +12,7 @@ use Kiri\Exception\ConfigException;
|
|||||||
use Kiri\Message\Handler\Abstracts\HttpService;
|
use Kiri\Message\Handler\Abstracts\HttpService;
|
||||||
use Kiri\Server\Events\OnShutdown;
|
use Kiri\Server\Events\OnShutdown;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
|
use Kiri\Server\Events\OnServerBeforeStart;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use Swoole\Coroutine;
|
use Swoole\Coroutine;
|
||||||
|
|
||||||
@@ -94,6 +95,8 @@ class Server extends HttpService
|
|||||||
|
|
||||||
$this->container->get(ProcessManager::class)->batch($processes);
|
$this->container->get(ProcessManager::class)->batch($processes);
|
||||||
|
|
||||||
|
$this->eventDispatch->dispatch(new OnServerBeforeStart());
|
||||||
|
|
||||||
return $this->manager->getServer()->start();
|
return $this->manager->getServer()->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ use Kiri\Abstracts\Component;
|
|||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Annotation\Inject;
|
use Kiri\Annotation\Inject;
|
||||||
use Kiri\Error\Logger;
|
use Kiri\Error\Logger;
|
||||||
use Kiri\Events\EventDispatch;
|
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
use Kiri\Server\Contract\OnCloseInterface;
|
use Kiri\Server\Contract\OnCloseInterface;
|
||||||
use Kiri\Server\Contract\OnConnectInterface;
|
use Kiri\Server\Contract\OnConnectInterface;
|
||||||
@@ -16,7 +15,6 @@ use Kiri\Server\Contract\OnHandshakeInterface;
|
|||||||
use Kiri\Server\Contract\OnMessageInterface;
|
use Kiri\Server\Contract\OnMessageInterface;
|
||||||
use Kiri\Server\Contract\OnPacketInterface;
|
use Kiri\Server\Contract\OnPacketInterface;
|
||||||
use Kiri\Server\Contract\OnReceiveInterface;
|
use Kiri\Server\Contract\OnReceiveInterface;
|
||||||
use Kiri\Server\Events\OnServerBeforeStart;
|
|
||||||
use Kiri\Server\Handler\OnPipeMessage;
|
use Kiri\Server\Handler\OnPipeMessage;
|
||||||
use Kiri\Server\Handler\OnServer;
|
use Kiri\Server\Handler\OnServer;
|
||||||
use Kiri\Server\Handler\OnServerManager;
|
use Kiri\Server\Handler\OnServerManager;
|
||||||
@@ -25,7 +23,6 @@ use Kiri\Server\Handler\OnServerWorker;
|
|||||||
use Kiri\Server\Tasker\OnServerTask;
|
use Kiri\Server\Tasker\OnServerTask;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use ReflectionException;
|
|
||||||
use Swoole\Http\Server as HServer;
|
use Swoole\Http\Server as HServer;
|
||||||
use Swoole\Process;
|
use Swoole\Process;
|
||||||
use Swoole\Server;
|
use Swoole\Server;
|
||||||
@@ -95,11 +92,9 @@ class ServerManager extends Component
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Server|WServer|HServer|null
|
* @return Server|WServer|HServer|null
|
||||||
* @throws ReflectionException
|
|
||||||
*/
|
*/
|
||||||
public function getServer(): Server|WServer|HServer|null
|
public function getServer(): Server|WServer|HServer|null
|
||||||
{
|
{
|
||||||
di(EventDispatch::class)->dispatch(new OnServerBeforeStart());
|
|
||||||
return $this->server;
|
return $this->server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user