Open jrudolph opened 4 years ago
Part of the discussion is also about doing load-balancing as discussed in #3505. There we discussed the idea that an HTTP/2 pool would only care for reconnection and request/response management and load-balancing would be built on top of that.
An HTTP2 outgoingConnection already has almost the needed semantics to be used as a pool. The main challenge here would be how to detect that a server supports HTTP/2 before even instantiating the connection.
That's needed because, while we could do negotiation between HTTP/1 and HTTP/2 in
Http2.outgoingConnection
the semantics would be so different (1 vs. multiple concurrent requests) that it wouldn't help. So, in thePoolInterface
we need some probing when a pool is created and either create a pool for an HTTP/1.1 endpoint or create "just" an HTTP2 outgoing connection if that is supported.Make sure to add documentation and examples for public APIs.
Features the pool would provide for HTTP/2 over a single plain connection: