Motivation:
Remove `NIOHTTP2StreamDelegate` `Sendable` conformance requirement.
This wasn't needed in the first place because `NIOHTTP2Handler`
is not `Sendable`, therefore it never leaves the thread on which it is
created.
The delegate may still be `Sendable` depending on the implementation
but it is not a strict requirement.
Modifications:
Remove NIOHTTP2StreamDelegate Sendable requirement
Result:
Sendable is no longer required for NIOHTTP2StreamDelegate conformance
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:
`NIOHTTP2Handler`s init'd with a `streamDelegate` will now call into
that delegate's `streamCreated` and `streamClosed` functions.
Motivation:
Less expensive stream multiplexing. To implement direct stream multiplexing (with an incomplete public API) to break up delivery and allow testing.
Modifications:
* Factor out common inbound stream multiplexer functionality from `HTTP2StreamMultiplexer` into `CommonInboundStreamMultiplexer` (first commit).
* Direct stream multiplexing is implemented as `InlineStreamMultiplexer`. It implements both the `HTTP2InboundStreamMultiplexer` and `HTTP2OutboundStreamMultiplexer` protocols.
* We expose `NIOHTTP2Hander.StreamMultiplexer` as a `public` view over the new multiplexer to allow stream creation.
* Adds various `propagate...` functions to relay signals such as read complete to the child channels held by the inline stream multiplexer.
* Adds a stub for `HTTP2StreamDelegate` which will be completed in an upcoming PR. It will be responsible for surfacing stream open/close information.
* Adds conveniences to `NIOHTTP2Handler` for setting up a handler using the inline multiplexer
* Duplicate existing tests and modify to use the inline stream multiplexer where appropriate. `SimpleClientServerFramePayloadStreamTests.swift` and `HTTP2FramePayloadStreamMultiplexerTests.swift` were copied and modified
Result:
Default behavior should be unchanged at this time.