netty/netty — Issue #68: Simplify Channel state event model
Author: trustin
Created: 2011-11-18 01:00:58+00:00
State: open
Labels: feature

When a new channel goes into service or out of service, we see the following events:

* `channelOpen`
* `channelBound`
* `channelConnected`
* `channelDisconnected`
* `channelUnbound`
* `channelClosed`

Do we really need all these 3 events per (dis)connection?

Why don't we just simplify like this:

* Make `Channel` implementations public so that people can extend it and perform additional action in the constructor - this replaces `channelOpen`
* Replace `channelBound` and `channelConnected` with `channelAttached`.
* Replace `channelDisconnected`, `channelUnbound`, and `channelClosed` with `channelDetached`.

However, `channelAttached` and `channelDetached` is not exactly same with the replaced events because a user can attach an unconnected channel to an event loop. I think a user can simply add a listener to the returned `ChannelFuture`.

Related issues: #66, #67