User Guide for 3.1 updated - please comment!

Frederic Bregier fredbregier at free.fr
Sat Apr 18 04:02:08 EDT 2009


Hi,

Sometimes, in the pipeline, you need to add an handler that is at both time an Upstream and a Downstream. So, if you separate those pipelines, you will be contrained to develop some specific workaround to fit such handlers that could be splitten in two but still need to be synchronized for attributes for instance.
One example is the TrafficShaping I try to get into Netty. Perhaps it is doable to separate both up and down, but it will lead to some extra programming and effort, specially for the Counter itself which is both up and down.
Also, sometimes there is the need to trap some up or down events in contrary to the primary type of the handler, so the SimpleChannelHandler.

My two cents too,

Frederic


Hi trustin:

thanks for the pointer of ACE. I am just not familiar with ACE terms.

I just get another idea for upstream and downstream things. When building a
pipeline, I don't know exactly what kind of order I should use to add
handlers, and when both upstream handlers and downstream handlers are added,
it is more complicated to get a clear idea about the execution order of
handlers. So how about adding two classes of handlers into different
handlers collection, like:

        // add upstream handers that process upstream events only
        pipeline.addUpstreamHandler("framer", new
LengthFieldBasedFrameDecoder(20480, 0, 4, 0 ,4));
        pipeline.addUpstreamHandler("decoder", new StringEncoder());

        // add downstream handlers that process downstream events only
        pipeline.addDownstreamHandler("encoder", new StringEncoder());
        pipeline.addDownstreamHandler("lengthHeaderEncoder", new
LengthFieldPrepender(4));

        // when it comes to the end of filter chain, our business logic
handler takes over. Note: MyApplicationHandler is supposed to process both
upstream and downstream events
        pipeline.addApplicationHandler("application", new
MyApplicationHandler());

This kind of handlers chain seems more clear. Just my 2 cents.

yanky



-----
Hardware/Software Architect
-- 
View this message in context: http://n2.nabble.com/User-Guide-for-3.1-updated---please-comment%21-tp2616771p2654728.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list