question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Netty 5] AttributeMap removal

See original GitHub issue

We want to remove the AttributeMap and also the attr(...) method from the Channel / ChannelHandlerContext.

There are two possibilities for this:

  • provide another way to map things to a Channel. How exactly this is done is not clear yet, but perhaps the extensibility improvements will allow for wrapping the Channel, or state can be kept in a ChannelHandler.
  • Just don’t offer a replacement and have the user use stateful ChannelHandler.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
trustincommented, Nov 21, 2018

I find the ability to attach an arbitrary object to a Channel very useful in practice, especially when I do not wish to introduce tight coupling between handlers or when there’s stateful information that do not belong to any handlers. The AttributeMap API is somewhat ugly although it serves my needs well.

2reactions
normanmaurercommented, Nov 13, 2018

@johnou I am not convinced that this is the right thing to use for every read. For every read you should store the state directly in the ChannelHandler IMHO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Netty 5 Migration Guide
In the case of you using attributes you should directly use Channel which still extends AttributeMap . Channel.Unsafe removal. The Channel.Unsafe interface was ......
Read more >
New and noteworthy in 5.0 - Netty.docs
In the case of you using attributes you should directly use Channel which still extends AttributeMap . ChannelPipeline.add*(EventExecutorGroup...) removed. In ...
Read more >
Attribute (Netty API Reference (5.0.0.Alpha4))
Removes this attribute from the AttributeMap and returns the old value. ... Because of this special caution should be taken when you call...
Read more >
Netty 5.0.0.Alpha3 released - Netty.news
ChannelHandlerContext does not extend AttributeMap anymore; Make half-closure a core-concept of Channel; Allow sending "custom" events in both ...
Read more >
DefaultAttributeMap (Netty API Reference (5.0.0.Alpha4))
public class DefaultAttributeMap extends Object implements AttributeMap ... Attributes lookup and remove exibit O(logn) time worst-case complexity, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found