定制 riki137/amp-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

riki137/amp-client

最新稳定版本:7.0.3

Composer 安装命令:

composer require riki137/amp-client

包简介

PHP8.2+ AMPHPv3 adapter for Symfony HttpClient

关键字:

README 文档

README

This package is deprecated and should be replaced by efabrica/revolt-curl-client.

This is a partial fork of @nicolas-grekas 's pull request for SymfonyHttpClient that adds support for using AMPHPv3 (AMPHP HTTPClient v5) with PHP >= 8.2 instead of waiting for PHP 8.4.

This is not a full fork that replaces the original Symfony HttpClient, but a separate package that can be used alongside it.

The code for HTTP client and it's other adapters is removed, only it's AMPHPv3-related and necessary @internal code is kept.

It solves the problem of the destructor suspension by deferring the destruction.

Usage

composer require riki137/amp-client
use Riki137\AmpClient\AmpHttpClientV5;

$client = new AmpHttpClientV5($options, null, $maxHostConnections, $maxPendingPushes); 
// implements HttpClientInterface, as you're used to
$client->request('GET', 'https://example.com');

If you use this client, you should include this piece of code that executes when your application is closing (onShutdown, terminate event, etc.):

\Revolt\EventLoop::run();

This ensures that all pending requests are completed before the application is closed and allows you to avoid PHP <8.4's destructor suspension.

统计信息

  • 总下载量: 1.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 53
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-03