feat(http2): add a pooled, multiplexed HTTP/2 http.Client - #1956
Open
demolaf wants to merge 37 commits into
Open
feat(http2): add a pooled, multiplexed HTTP/2 http.Client#1956demolaf wants to merge 37 commits into
demolaf wants to merge 37 commits into
Conversation
demolaf
marked this pull request as draft
July 30, 2026 09:43
demolaf
marked this pull request as ready for review
July 30, 2026 13:14
mosuem
reviewed
Aug 3, 2026
brianquinlan
reviewed
Aug 3, 2026
brianquinlan
left a comment
Collaborator
There was a problem hiding this comment.
I'll have more review feedback tomorrow. Also, this PR adds (preliminary) conformance tests: #1960
You might want to add them to this PR.
…xConcurrentStreams
demolaf
force-pushed
the
pooled-http2-client
branch
from
August 6, 2026 14:08
e8b8590 to
39b75f9
Compare
Author
|
@brianquinlan @mosuem I'm deferring the TODOs in the conformance tests to a later PR since this is already quite a lot, sounds good? |
brianquinlan
reviewed
Aug 6, 2026
demolaf
force-pushed
the
pooled-http2-client
branch
from
August 14, 2026 17:25
90b0813 to
af53e7f
Compare
demolaf
force-pushed
the
pooled-http2-client
branch
from
August 14, 2026 18:30
a5cea15 to
a05fb28
Compare
…d-http2-client # Conflicts: # pkgs/http2/CHANGELOG.md
| is safe to reuse across requests to different hosts. Note that it speaks only | ||
| HTTP/2 and does not fall back to HTTP/1.1: a server that does not negotiate | ||
| `h2` is treated as an error. See the example | ||
| [here](example/pooled_client.dart). |
Collaborator
There was a problem hiding this comment.
Could you rename the example "main.dart" and update this link? Otherwise I think that we are good to go!
brianquinlan
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1385
Adds
Http2Client, a pooled, multiplexedhttp.Clientbacked by HTTP/2 connections, plus theClientPoolit's built on — fixesdart:io'sHttpClientopening one connection per concurrent request. Ported and generalized from a downstream implementation built for firebase/firebase-admin-dart#305.ClientPool: most-full-first packing, idle GC, failure retirement, and a lease API so a slot can outlive the call that claimed itHttp2Client: pools perhost:port, caps concurrent handshakes globally, multi-host safe (e.g. asgoogleapis_auth'sbaseClient)SETTINGS_MAX_CONCURRENT_STREAMSallows, and doesn't use a connection at all until that frame has arrived — seeHttp2Client.settingsTimeoutClientTransportConnection.peerMaxConcurrentStreams. This is a new member on an implementable class, hence the minor version bump