apple / swift-nio-http2

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

Expose a functional `NIOHTTP2StreamDelegate` #382

Closed rnro closed 1 year ago

rnro commented 1 year ago

Motivation:

Allow handlers in the pipeline to be notified when an HTTP2 stream is created or closed.

Modifications:

Store an instance of a NIOHTTP2StreamDelegate on the NIOHTTP2Handler and InlineStreamMultiplexer so that it may be called when streams are created or closed.

Added tests.

Result:

NIOHTTP2Handlers init'd with a streamDelegate will now call into that delegate's streamCreated and streamClosed functions.

rnro commented 1 year ago

I think this API breakage is fine. It's in the stream delegate which I just introduced and hasn't been in a release yet.