This commit is contained in:
2021-01-04 18:21:37 +08:00
parent 4c8e81f417
commit aa7b663967
3 changed files with 72 additions and 25 deletions
+13
View File
@@ -23,6 +23,7 @@ use HttpServer\Service\Receive;
use HttpServer\Service\Websocket;
use Kafka\Producer;
use Annotation\Annotation as SAnnotation;
use Snowflake\Async;
use Snowflake\Cache\Redis;
use Snowflake\Di\Service;
use Snowflake\Error\ErrorHandler;
@@ -46,6 +47,7 @@ use Database\DatabasesProviders;
* @property \Redis|Redis $redis
* @property Server $server
* @property DatabasesProviders $db
* @property Async $async
* @property Connection $connections
* @property Logger $logger
* @property Jwt $jwt
@@ -391,6 +393,16 @@ abstract class BaseApplication extends Service
}
/**
* @return Async
* @throws ComponentException
*/
public function getAsync(): Async
{
return $this->get('async');
}
/**
* @throws Exception
*/
@@ -410,6 +422,7 @@ abstract class BaseApplication extends Service
'router' => ['class' => Router::class],
'redis' => ['class' => Redis::class],
'jwt' => ['class' => Jwt::class],
'async' => ['class' => Async::class],
'goto' => ['class' => BaseGoto::class],
'http2' => ['class' => Http2::class],
]);