HTTP/2 negotiated connection pipeline config (#408)

Motivation:

This continues the work to expose functionality which allows users to interact
with HTTP/2 connections via async abstractions and using structured
concurrency.

This work enables protocol negotiation between HTTP/1.1 and HTTP/2 in its most generic form.

Modifications:

Enable protocol negotiation between HTTP/1.1 and HTTP/2 using typed
negotiation results (`NIOProtocolNegotiationResult`) from the
`NIOTypedApplicationProtocolNegotiationHandler`.
In the HTTP/2 case the negotiation result will return the HTTP/2 connection
channel and the `NIOHTTP2Handler.AsyncStreamMultiplexer` which exposes
inbound streams as an iterable async stream.

Result:

Users will be able to set up negotiated HTTP/1.1 / HTTP/2 connections and
iterate over inbound streams.
This commit is contained in:
Rick Newton-Rogers authored and GitHub committed 2023-07-12 11:07:53 +01:00
1 parent 188fa9ba27
commit 044339de7b
8 files changed
+562 -281

No files matched your search

+1 -1
View File
@@ -230,7 +230,7 @@ final class HTTP2StreamChannel: Channel, ChannelCore {
}
}
internal func configure<Output>(initializer: @escaping NIOHTTP2Handler.StreamInitializerWithOutput<Output>, userPromise promise: EventLoopPromise<Output>?) {
internal func configure<Output>(initializer: @escaping NIOChannelInitializerWithOutput<Output>, userPromise promise: EventLoopPromise<Output>?) {
assert(self.streamDataType == .framePayload)
// We need to configure this channel. This involves doing four things:
// 1. Setting our autoRead state from the parent