[JBoss JIRA] Created: (NETTY-93) ChannelLocal (as a counterpart of ThreadLocal)
Trustin Lee (JIRA)
jira-events at lists.jboss.org
Tue Dec 2 19:37:36 EST 2008
ChannelLocal (as a counterpart of ThreadLocal)
----------------------------------------------
Key: NETTY-93
URL: https://jira.jboss.org/jira/browse/NETTY-93
Project: Netty
Issue Type: Feature Request
Components: Core API
Reporter: Trustin Lee
Assignee: Trustin Lee
Priority: Minor
Fix For: 3.1.0.ALPHA2
There has been requests about adding get/setAttribute(..) to Channel interface. I don't disagree about the idea, but there's a couple issues with it:
* Channel interface should be kept minimal.
* An attribute map is an optional feature - a user can store one's application's state without the attribute map
* An attribute map often takes up too much space because each Channel conveys a HashMap or ConcurrentHashMap.
ChannelLocal could be added as an alternative solution for the demand for the attribute map. It essentially is similar to ThreadLocal. ChannelLocal stores a value per Channel, while ThreadLocal stores a value per Thread. By providing ChannelLocal:
* Channel interface doesn't change.
* ChannelLocal can be used as an attribute map and it's optional.
* ChannelLocal maintains a Map per attribute type, and therefore there's low probability of wasting memory.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the netty-dev
mailing list