[RFC] ConnectionPool rewrite and http/2 support #376
Closed
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.
This is a draft pr for a ConnectionPool reimplementation that opens the door for http/2 support. This pr has grown very large and I will need to split it up to actually land in parts. However I see benefit in showing the goal down the road. I would love some early feedback. The next step shall be to split code parts out that can go into code review on its own.
Goals
http/2A high level overview:
HTTPConnectionPoolis a new connection pool implementation for a single connection target (as inConnectionPool.Key) replacingHTTP1ConnectionProviderHTTPConnectionPool.StateMachineis the matchingStateMachinefor theHTTPConnectionPool. It has two potential substate machines:HTTPConnectionPool.HTTP1ConnectionStatefor a remote targets that support http/1.1 onlyHTTPConnectionPool.HTTP2ConnectionStatefor a remote targets that support http/2 onlyHTTPConnectionPool.Connectionis a box around the actual connection forHTTP1ConnectionandHTTP2Connectionthat is used in the connection pool state machineHTTPConnectionPool.Manageris a new manager of all connection pools. (thus replacingConnectionPool)HTTPConnectionPool.Factoryis responsible for creating new HTTP connections and replaces the connection setup currently inUtils.swiftHTTP1Connectionis a wrapper around aChannel. A notable change to before isHTTP1ClientChannelHandleris a new channel handler that can be reused for multiple requests.HTTP1ConnectionStateMachineis a new state machine that is used byHTTP1ClientChannelHandlerHTTP1ConnectionStateMachineuses theHTTPRequestStateMachineas a substate machine.State
http/2is disabled at the moment.http/2is very under tested