This commit is contained in:
2021-08-18 11:56:19 +08:00
parent f375eec0a0
commit 99e2f36794
9 changed files with 21 additions and 14 deletions
+4 -3
View File
@@ -213,11 +213,11 @@ abstract class BaseApplication extends Component
/**
* @param TaskExecute $execute
* @throws ReflectionException
* @throws ReflectionException|NotFindClassException
*/
public function task(TaskExecute $execute): void
{
ServerManager::getContext()->task($execute);
di(ServerManager::class)->task($execute);
}
@@ -400,10 +400,11 @@ abstract class BaseApplication extends Component
/**
* @return \Swoole\Http\Server|\Swoole\Server|\Swoole\WebSocket\Server|null
* @throws
*/
public function getSwoole(): \Swoole\Http\Server|\Swoole\Server|\Swoole\WebSocket\Server|null
{
return ServerManager::getContext()->getServer();
return di(ServerManager::class)->getServer();
}