-
Notifications
You must be signed in to change notification settings - Fork 18
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
Provide equivalent of Agent to manage ClientHttp2Sessions across requests #6
Comments
The DNS-related functionalities shouldn't be built-in. But, our agent class should make it possible to do. See the examples (using HTTP1 Agent):
https://gist.github.com/szmarczak/d29efa57d085fd7acc4e8b157f39cb45
https://gist.github.com/szmarczak/8dcf43d4c57ff952424642afe0ebada2 |
Sorry I've deleted all of our comments but I needed to clean up this place. I've rewritten the H2 Agent. Take a look at it (there are still some things to do, eg. correct session picking and
✔️
✔️
We could retry failed sessions... but it's quite useless. Imagine all seats for free sockets are taken. You need to close one and make another... The retry logic should stay in a high level packages like Got.
✔️
It won't be compatible at all with the H1 Agent. Making a compatibility layer is a hard topic. The design completely differs. I mean it's possible but it's just fixing Node. |
To get to a fully transparent solution, on par with
Agent
for h1, we should look at providing aClientHttp2Session
manager that takes on the following responsibilities:ClientHttp2Session
We should expose both an
Agent
and new H2-oriented interface, so this connection pool can transparently support both protocols. This is necessary when we're connecting to a remote host and determine that it does not support h2, then we like to reuse that existing TLS connection over h1. If we expose anAgent
interface`, we can reuse the TLS connection.Ideally, this component is also DNS-aware, meaning that it could do the following:
The text was updated successfully, but these errors were encountered: