Files
kiri-core/HttpServer/Client/HttpClient.php
T
2020-11-17 10:44:29 +08:00

37 lines
486 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()
{
return Snowflake::app()->http2;
}
}