Thanks to all the feed back we received since 4.0.0.Alpha1, we were able to release another round of alpha version of Netty 4.0.0. Get it, and the following is the notable changes since Alpha1 (If you want the exhaustive list of the changes, visit . If you are curious about what's new since 3.x, read ):
EventLoop is split into EventLoopGroup and EventLoop
In Alpha1, EventLoop represented both an individual I/O thread and a pool of those threads. I must admit it was somewhat confusing in some cases. From Alpha2, EventLoopGroup represents a group of one or more EventLoops, and EventLoop represents a single I/O thread.
Because of this change, your bootstrap code needs the following change:
Read suspension implemented, way better
One of the missing features in Alpha1 comparing to 3.x was read suspension, but it's now back with more sensible way of inbound traffic suspension.
3.x had an unintuitive inbound traffic suspension mechanism provided by Channel.setReadable(boolean). It introduced complicated interactions between ChannelHandlers and the handlers were easy to interfere with each other if implemented incorrectly.
In 4.0, each ChannelHandler is given with its own boolean flag called 'readable' in its ChannelHandlerContext. The flag tells if the handler wants Netty to read inbound traffic or not. It works like a consensus system. If any of the boolean flags in the pipeline is set to false, Netty will suspend read operation. If all of the boolean flags in the pipeline are set to true, Netty will resume read operation.
ChannelFuture implements Future<Void>
ChannelFuture now implements java.util.concurrent.Future<Void>.
HttpMessage.chunked is gone!
HttpMessage.chunked property has been replaced by a new property called 'transferEncoding' to address the ambiguity of the old property. The 'chunked' property, in spite of its confusing name, was not necessarily related with HTTP chunked transfer coding, but it just meant to represent an HttpMessage which is followed by HttpChunks. For more information, refer to the API documentation of.
Want more changes? It's up to you!
Netty 4 is still at alpha stage - there are so many opportunities where your constructive feed back will make Netty 4 better than ever. Let me look forward toand letting people know what you think.