feat(http2): add a pooled, multiplexed HTTP/2 http.Client - #1956
Open
demolaf wants to merge 14 commits into
Open
feat(http2): add a pooled, multiplexed HTTP/2 http.Client#1956demolaf wants to merge 14 commits into
demolaf wants to merge 14 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.
| /// networks - do not use it to accept arbitrary certificates in production. | ||
| class Http2Client extends BaseClient { | ||
| Http2Client({ | ||
| this.maxStreamsPerConnection = 100, |
Collaborator
There was a problem hiding this comment.
Should this default to SETTINGS_MAX_CONCURRENT_STREAMS send by the server?
Author
There was a problem hiding this comment.
yes, this should read SETTINGS_MAX_CONCURRENT_STREAMS returned from the server. i'll make that change now
Author
There was a problem hiding this comment.
_settingsHandler.peerSettings.maxConcurrentStreams isn't exposed in the public API as of now. So I'll need to add a getter e.g. peerMaxConcurrentStreams on ClientTransportConnection which can then be used in Http2Client.
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 the genericClientPool<T>it'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<T>: most-full-first packing, idle GC, failure retirement, awaitable gracefulterminate()Http2Client: pools perhost:port, caps concurrent handshakes globally, multi-host safe (e.g. asgoogleapis_auth'sbaseClient)ClientPooland integration tests forHttp2Clientcovering multi-host pooling, connection-cap dialing, graceful terminate, and the peer-close retry