Yes, much better now, thanks!<br><br><div class="gmail_quote">On Wed, Apr 8, 2009 at 1:41 AM, Trustin Lee <span dir="ltr">&lt;<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;ve just updated the Javadoc of ChannelPipeline.  I hope you like<br>
this improvement. :)<br>
<font color="#888888"><br>
— Trustin Lee, <a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
</font><div><div></div><div class="h5"><br>
On Wed, Mar 11, 2009 at 8:36 AM, Utkarsh Srivastava &lt;<a href="mailto:utkarsh@gmail.com">utkarsh@gmail.com</a>&gt; wrote:<br>
&gt; Yes, thanks, its clear now. I think this deserves a mention in the docs,<br>
&gt; otherwise its too mysterious.<br>
&gt;<br>
&gt; Utkarsh<br>
&gt;<br>
&gt; On Tue, Mar 10, 2009 at 3:11 PM, Trustin Lee &lt;<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Mar 11, 2009 at 6:30 AM, Utkarsh Srivastava &lt;<a href="mailto:utkarsh@gmail.com">utkarsh@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am a day old to netty and still finding my way around. Looks like a<br>
&gt;&gt; &gt; really<br>
&gt;&gt; &gt; slick framework!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am having a little trouble understanding the handler pipeline (yes, I<br>
&gt;&gt; &gt; have<br>
&gt;&gt; &gt; read the api docs for ChannelPipeline, ChannelHandler and ChannelEvent).<br>
&gt;&gt; &gt; To<br>
&gt;&gt; &gt; take a concrete example, the server pipeline in the example time server<br>
&gt;&gt; &gt; has<br>
&gt;&gt; &gt; the following pipeline:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         ChannelPipeline p = pipeline();<br>
&gt;&gt; &gt;         1. p.addLast(&quot;frameDecoder&quot;, new<br>
&gt;&gt; &gt; LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4));<br>
&gt;&gt; &gt;         2. p.addLast(&quot;protobufDecoder&quot;, new<br>
&gt;&gt; &gt; ProtobufDecoder(LocalTimeProtocol.Locations.getDefaultInstance()));<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         3. p.addLast(&quot;frameEncoder&quot;, new LengthFieldPrepender(4));<br>
&gt;&gt; &gt;         4. p.addLast(&quot;protobufEncoder&quot;, new ProtobufEncoder());<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         5. p.addLast(&quot;handler&quot;, new LocalTimeServerHandler());<br>
&gt;&gt; &gt;         return p;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; For a given request, handlers are executed in the order 1,2,5,4,3,<br>
&gt;&gt; &gt; right?<br>
&gt;&gt; &gt; Thats the only order that makes sense.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; But thats totally different from the order they are added to the<br>
&gt;&gt; &gt; pipeline in<br>
&gt;&gt; &gt; the code.<br>
&gt;&gt;<br>
&gt;&gt; That&#39;s a good question.  When an event goes upstream, the order is 1,<br>
&gt;&gt; 2, 3, 4, 5.  When an event goes downstream, the order is 5, 4, 3, 2,<br>
&gt;&gt; 1.  However, ChannelPipline does some trick to shorten the stack<br>
&gt;&gt; depth.<br>
&gt;&gt;<br>
&gt;&gt; 3 and 4 don&#39;t implement ChannelUpstreamHandler, and therefore the<br>
&gt;&gt; actual evaluation order of an upstream event will be: 1, 2, and 5.<br>
&gt;&gt;<br>
&gt;&gt; 1, 2, and 5 don&#39;t implement ChannelDownstreamHandler, and therefore<br>
&gt;&gt; the actual evaluation order of a downstream event will be: 4 and 3<br>
&gt;&gt;<br>
&gt;&gt; If 5 extends SimpleChannelHandler, it means 5 implements both<br>
&gt;&gt; ChannelUpstreamHandler and ChannelDownstreamHandler.  Therefore the<br>
&gt;&gt; evaluation order for upstream and downstream events will be 125 and<br>
&gt;&gt; 543.<br>
&gt;&gt;<br>
&gt;&gt; Sounds clear? :)<br>
&gt;&gt;<br>
&gt;&gt; HTH,<br>
&gt;&gt; Trustin<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; netty-users mailing list<br>
&gt;&gt; <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; netty-users mailing list<br>
&gt; <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
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>