We just released our new async APIs but forgot to mark the new types as Sendable. This is causing warnings for users and we should properly mark them as Sendable since we expect users to use them from concurrent contexts.
Modification
Adding Sendable to the NIONegotiatedHTTPVersion was pretty straight forward; however, adding Sendable to AsyncStreamMultiplexer was a bit more complicated since it stored the InlineStreamMultiplexer which we cannot easily make Sendable. Hence, we are now holding the InlineStreamMultiplexer in a NIOLoopBound and are submitting the work to the correct EventLoop before we call the underlying multiplexer.
Motivation
We just released our new async APIs but forgot to mark the new types as
Sendable
. This is causing warnings for users and we should properly mark them asSendable
since we expect users to use them from concurrent contexts.Modification
Adding
Sendable
to theNIONegotiatedHTTPVersion
was pretty straight forward; however, addingSendable
toAsyncStreamMultiplexer
was a bit more complicated since it stored theInlineStreamMultiplexer
which we cannot easily makeSendable
. Hence, we are now holding theInlineStreamMultiplexer
in aNIOLoopBound
and are submitting the work to the correctEventLoop
before we call the underlying multiplexer.Result
No more
Sendable
warnings for our users.