Question: Why ExecutionHandler in netty only support upstream?

"Trustin Lee (이희승)" trustin at gmail.com
Wed Mar 24 02:39:54 EDT 2010


Hi,

李巍 wrote:
> Dear netty users
> 
>     Netty is supposed to support SEDA (Staged Event-Driven Architecture),
> but in org.jboss.netty.handler.execution.ExecutionHandler, the executor is
> only used in handleUpstream(), what about handleDownstream()? If I want to
> only put the encoding logic in another thread pool, how to deal with that?
> If I remember correctly, Mina support this.

I doubt it will improve performance significantly, and that's why I
didn't put such feature to Netty.  If you really want to do that, you could:

  1) Copy ChannelEventRunnable and modify run() method to call
ctx.sendDownstream() instead of sendUpstream().
  2) Call executor.execute(new ChannelEventRunnable2(evt)) in
handleDownstream():

    public void handleDownstream(ctx, e) {
        executor.execute(new ChannelEventRunnable2(evt));
    }

HTH,
Trustin

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100324/8d1d315e/attachment-0001.bin 


More information about the netty-users mailing list