Netty 5.0.0.Alpha3 已发布,这是一个重要的里程碑,此版本迁移了所有代码——以使用新的Buffer API,并完全移除ByteBuf。
主要变化
- 所有代码现在使用
Buffer(新的 buffer API) - 移除
ChannelInboundHandler - 移除
Http2MultiplexCodec和Http2MultiplexCodecBuilder - 为
Buffer,EventLoop,Future添加多个便捷的方法 ChannelHandlerContext不再对AttributeMap进行扩展- 将 half-closure 作为 Channel 的 core-concept
- 支持双向发送 "custom" 事件
- Remove blocking methods from
Futureinterface, people need to useFuture.asStage()to gain access to blocking methods - 从
Future接口移除阻塞方法,开发者需要使用Future.asStage()才能访问阻塞方法 - 移除
Channel.Unsafe - 从
ChannelAPI 移除ChannelOutboundBuffer,作为AbstractChannel的实现细节 - 移除
@Sharable,使用ChannelHandler.isSharable()替代 - 移除
EventLoop.Unsafe,并添加EventLoop.registerForIo(...)/EventLoop.deregisterForIo(...) - 将
Channel.bytesBeforeUnwritable()重命名为Channel.writableBytes() - 添加 ProtocolEvent 并让 SSL 和 WebSocket 实现使用它
- 将通用逻辑移动至
AbstractChannel,从而使实现更容易重用代码,还要确保重命名受保护的方法,以更加一致
详情。




还没有评论,来说两句吧...