Files
kiri-core/HttpServer/Client/HttpClient.php
T
2020-12-17 14:12:44 +08:00

38 lines
494 B
PHP

<?php
namespace HttpServer\Client;
use Snowflake\Abstracts\Component;
use Snowflake\Snowflake;
use Swoole\Coroutine;
/**
* Class ClientDriver
* @package HttpServer\Client
*/
class HttpClient extends Component
{
/**
* @return IClient
*/
public static function NewRequest(): IClient
{
return Coroutine::getCid() > 0 ? Client::NewRequest() : Curl::NewRequest();
}
/**
* @return Http2
*/
public static function http2(): Http2
{
return Snowflake::app()->http2;
}
}