Hi:<br><br>That&#39;s true that in some cases both of them are needed. Maybe it is more flexible to just leave it. <br><br>yanky<br><br><div class="gmail_quote">2009/4/18 Frederic Bregier <span dir="ltr">&lt;<a href="mailto:fredbregier@free.fr">fredbregier@free.fr</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi,<br>
<br>
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.<br>

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.<br>

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.<br>
<br>
My two cents too,<br>
<br>
Frederic<br>
<div class="im"><br>
<br>
Hi trustin:<br>
<br>
thanks for the pointer of ACE. I am just not familiar with ACE terms.<br>
<br>
I just get another idea for upstream and downstream things. When building a<br>
pipeline, I don&#39;t know exactly what kind of order I should use to add<br>
handlers, and when both upstream handlers and downstream handlers are added,<br>
it is more complicated to get a clear idea about the execution order of<br>
handlers. So how about adding two classes of handlers into different<br>
handlers collection, like:<br>
<br>
        // add upstream handers that process upstream events only<br>
        pipeline.addUpstreamHandler(&quot;framer&quot;, new<br>
LengthFieldBasedFrameDecoder(20480, 0, 4, 0 ,4));<br>
        pipeline.addUpstreamHandler(&quot;decoder&quot;, new StringEncoder());<br>
<br>
        // add downstream handlers that process downstream events only<br>
        pipeline.addDownstreamHandler(&quot;encoder&quot;, new StringEncoder());<br>
        pipeline.addDownstreamHandler(&quot;lengthHeaderEncoder&quot;, new<br>
LengthFieldPrepender(4));<br>
<br>
        // when it comes to the end of filter chain, our business logic<br>
handler takes over. Note: MyApplicationHandler is supposed to process both<br>
upstream and downstream events<br>
        pipeline.addApplicationHandler(&quot;application&quot;, new<br>
MyApplicationHandler());<br>
<br>
This kind of handlers chain seems more clear. Just my 2 cents.<br>
<br>
yanky<br>
<br>
<br>
<br>
</div>-----<br>
Hardware/Software Architect<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n2.nabble.com/User-Guide-for-3.1-updated---please-comment%21-tp2616771p2654728.html" target="_blank">http://n2.nabble.com/User-Guide-for-3.1-updated---please-comment%21-tp2616771p2654728.html</a><br>

</font><div class="im">Sent from the Netty User Group mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
</div></div></blockquote></div><br>