<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><div>Dear netty users</div>
<div><br></div><div>    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.</div>
<div><br></div><div>    I tried to write related classes(attached) to support this, but failed to get it run. The application failed at startup. If enable that in client mode, even can not build socket connection with server.</div>
<div>    I hope someone can help me. thanks in advance.</div><div><br></div><div>class ExecutionHandler</div><div><br></div><div>    public void handleUpstream(</div><div>            ChannelHandlerContext context, ChannelEvent e) throws Exception {</div>
<div>        executor.execute(new ChannelEventRunnable(context, e));</div><div>    }</div><div><br></div><div>    public void handleDownstream(</div><div>            ChannelHandlerContext ctx, ChannelEvent e) throws Exception {</div>
<div>        if (e instanceof ChannelStateEvent) {</div><div>            ChannelStateEvent cse = (ChannelStateEvent) e;</div><div>            if (cse.getState() == ChannelState.INTEREST_OPS &amp;&amp;</div><div>                (((Integer) cse.getValue()).intValue() &amp; Channel.OP_READ) != 0) {</div>
<div><br></div><div>                // setReadable(true) requested</div><div>                boolean readSuspended = ctx.getAttachment() != null;</div><div>                if (readSuspended) {</div><div>                    // Drop the request silently if MemoryAwareThreadPool has</div>
<div>                    // set the flag.</div><div>                    e.getFuture().setSuccess();</div><div>                    return;</div><div>                }</div><div>            }</div><div>        }</div><div><br>
</div><div>        ctx.sendDownstream(e);</div><div>    }</div><div><br></div><div><br></div></span></font>