swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

Remove the (un)wrap(In|Out)bound(In|Out) customisation points

Open weissi opened this issue 7 months ago • 0 comments

_EmittingChannelHandler, ChannelInboundHandler and ChannelOutboundHandler define bogus customisation points

  • func wrapOutboundOut(_ value: OutboundOut) -> NIOAny
  • func unwrapInboundIn(_ value: NIOAny) -> InboundIn
  • func wrapInboundOut(_ value: InboundOut) -> NIOAny
  • func unwrapOutboundIn(_ value: NIOAny) -> OutboundIn

they only have one correct implementation so they shouldn't be customisation points. This will also come with a (small) perf overhead.

Anyway, once possible we should remove them.


Given that they only have one correct implementation, we could actually just remove them without a SemVer major too. But as @Lukasa points out, some people seem to be using NIO in -enable-library-evolution mode where this would be an issue. So let's just leave it, the overhead is small and folks should use Self.(un)wrap(In|Out)bound(In|Out) anyway which doesn't have this issue.

weissi avatar Jul 17 '24 14:07 weissi