netty/netty — Issue #101: Allow to set/get attachment on Channel
Author: normanmaurer
Created: 2011-12-07 06:52:16+00:00
State: open
Labels: feature, improvement

Most users are looking for a way to assign some attachment to a Channel. At the moment they have two choices (out of the box).

1) Use a shared ChannelLocal instance for this
2) Use ChannelHandlerContext for this (the attachment is only visible in the ChannelHandler which belongs the the context here).

ChannelLocal is often not easy to spot for new-comers and also add some extra overhead because of the needed CAS semantic.

We should add methods to the Channel interface to set and get an Channel related attachment + @deprecate ChannelLocal. This will make it easier for users and also eliminate the overhead which ChannelLocal introduce.