Design question / getting reference to another handler - best practice
Peter Thomas
ptrthomas at gmail.com
Sun Oct 25 13:30:30 EDT 2009
Hi,
My first message to this list, I'm in the middle of re-writing something
that currently uses Mina, Netty looks very nice indeed.
I have a client pipeline for e.g. (towards server): A --> B (assume they
handle both upstream / downstream)
B encodes / decodes using a "chunk size" that can be changed by a server
message.
But the business logic of unpacking a "chunk size change" message is
responsibility of A.
I guess I have the following options of getting a reference to B and calling
a setter.
- initialize the pipeline so that A has a reference to B
- invent a new "internal" message and send it from A to B (but extra
message clutter, downcast / if-then)
- call methods on ChannelPipeline to get a reference to B
- use a ChannelLocal or attachment (but seems to be handler specific)
Any advice on which of the above would be recommended / discouraged, would
be greatly appreciated, maybe there are more ways I have missed.
Thanks,
Peter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20091025/e0cc818a/attachment.html
More information about the netty-users
mailing list