Files
swift-nio/Sources
Cory BenfieldandGeorge Barnett dc9edbb976 Create ChannelCore.removeHandlers(pipeline:) and use it (#1916)
Motivation:

A while back we added a ChannelCore extension method that would allow
removing handlers from a channel pipeline, in order to implement
Channels outside of NIO. This extension worked well, but it did assume
that you had a Channel to give it. There's no reason it needed a Channel
instead of just a ChannelPipeline, but it was based on the assumption
that Self would conform to Channel. Of course, this is usually true, but
it turns out not to always be true, and EmbeddedChannel is one example
where the Channel and ChannelCore are separate.

To that end, we shouldn't require using the Channel here, just the
ChannelPipeline. This will also let us force our NIO channels onto the
public API, which will make migrating to NIOCore easier.

Modifications:

- Deprecate ChannelCore.removeHandlers(channel:)
- Implement ChannelCore.removeHandlers(pipeline:)
- Swap existing Channel implementations to use the new method.

Result:

More consistent usage of our APIs.

Co-authored-by: George Barnett <gbarnett@apple.com>
2021-07-26 11:03:43 +01:00
..
2021-01-22 18:39:10 +00:00