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"><<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>></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'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 <<a href="mailto:utkarsh@gmail.com">utkarsh@gmail.com</a>> wrote:<br>
> Yes, thanks, its clear now. I think this deserves a mention in the docs,<br>
> otherwise its too mysterious.<br>
><br>
> Utkarsh<br>
><br>
> On Tue, Mar 10, 2009 at 3:11 PM, Trustin Lee <<a href="mailto:tlee@redhat.com">tlee@redhat.com</a>> wrote:<br>
>><br>
>> On Wed, Mar 11, 2009 at 6:30 AM, Utkarsh Srivastava <<a href="mailto:utkarsh@gmail.com">utkarsh@gmail.com</a>><br>
>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > I am a day old to netty and still finding my way around. Looks like a<br>
>> > really<br>
>> > slick framework!<br>
>> ><br>
>> > I am having a little trouble understanding the handler pipeline (yes, I<br>
>> > have<br>
>> > read the api docs for ChannelPipeline, ChannelHandler and ChannelEvent).<br>
>> > To<br>
>> > take a concrete example, the server pipeline in the example time server<br>
>> > has<br>
>> > the following pipeline:<br>
>> ><br>
>> > ChannelPipeline p = pipeline();<br>
>> > 1. p.addLast("frameDecoder", new<br>
>> > LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4));<br>
>> > 2. p.addLast("protobufDecoder", new<br>
>> > ProtobufDecoder(LocalTimeProtocol.Locations.getDefaultInstance()));<br>
>> ><br>
>> > 3. p.addLast("frameEncoder", new LengthFieldPrepender(4));<br>
>> > 4. p.addLast("protobufEncoder", new ProtobufEncoder());<br>
>> ><br>
>> > 5. p.addLast("handler", new LocalTimeServerHandler());<br>
>> > return p;<br>
>> ><br>
>> > For a given request, handlers are executed in the order 1,2,5,4,3,<br>
>> > right?<br>
>> > Thats the only order that makes sense.<br>
>> ><br>
>> > But thats totally different from the order they are added to the<br>
>> > pipeline in<br>
>> > the code.<br>
>><br>
>> That's a good question. When an event goes upstream, the order is 1,<br>
>> 2, 3, 4, 5. When an event goes downstream, the order is 5, 4, 3, 2,<br>
>> 1. However, ChannelPipline does some trick to shorten the stack<br>
>> depth.<br>
>><br>
>> 3 and 4 don't implement ChannelUpstreamHandler, and therefore the<br>
>> actual evaluation order of an upstream event will be: 1, 2, and 5.<br>
>><br>
>> 1, 2, and 5 don't implement ChannelDownstreamHandler, and therefore<br>
>> the actual evaluation order of a downstream event will be: 4 and 3<br>
>><br>
>> If 5 extends SimpleChannelHandler, it means 5 implements both<br>
>> ChannelUpstreamHandler and ChannelDownstreamHandler. Therefore the<br>
>> evaluation order for upstream and downstream events will be 125 and<br>
>> 543.<br>
>><br>
>> Sounds clear? :)<br>
>><br>
>> HTH,<br>
>> Trustin<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>
><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>
><br>
><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>