-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] Add support for amphp/http-client
v5
#54179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1f32cb8
to
bf0ddb2
Compare
2357160
to
e18f2b9
Compare
e18f2b9
to
a5fb61c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR ready.
amphp/socket issue moved to amphp/socket#114
Status: needs review
Thank you @nicolas-grekas. |
amphp/http-client
v5
It's still 8.1. Is it an issue? Shall we add logic to check the running PHP version ? |
We resolve this concern with https://packagist.org/packages/symfony/amphp-http-client-meta |
Do we need to document the symfony/amphp-http-client-meta package somewhere? |
Not sure, for userland, I think we already do the required runtime checks. |
This PR adds support for amphp/http-client version 5 as a transport for our HttpClient component.
It started as a draft at nicolas-grekas#43, which helped spot that PHP is missing the capability to suspend fibers in destructors. This was reported as php/php-src#11389 and is being fixed at php/php-src#13460.
Since the fix for php-src is going to land on PHP 8.4, using amphp/http-client version 5 will require php >= 8.4.
The implementation duplicates the one we have for v4 with the needed changes to use the v5 API. The difference are not big in size of code, but they're very low level (generators vs fibers). That would be quite useless to factor IMHO.