apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
462 stars 82 forks source link

HTTP/2 negotiated connection pipeline config #408

Closed rnro closed 1 year ago

rnro commented 1 year ago

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.

glbrntt commented 1 year ago

oh, looks like you regressed allocations @rnro

rnro commented 1 year ago

@swift-server-bot test this please

rnro commented 1 year ago

Rebased on top of https://github.com/apple/swift-nio-http2/pull/409

rnro commented 1 year ago

All of the API breakage is in code added since the last release. Almost all of it is Async... configuration functions, there are also some closure type aliases which they used but we've simplified and done away with.