Emmanuel Lecharny wrote:
On Mon, Feb 23, 2009 at 10:28 AM, Maarten Bosteels
<[email protected]> wrote:
I strongly disagree. IoSession is declared to be thread-safe. See the
javadoc [1]:

I have to go back to the code. I have been away from it since last
november, and it does not help to undertsand what's going on... My
bad.
Ok, I refreshed my mind a bit. Nothing worth reading the code :)

AFAICT, if you have an executorFilter before the protocolCodec filter, then you are safe.

I still have a question regarding the fact that you may need two exector filters : one for the incoming messages, and one for the outgoing messages. Hopefully, you can select the events each executor is responsible for :
- IoEventType.WRITE
- IoEventType.MESSAGE_RECEIVED
- ...

Remember that 'before' means after when applied to writes ! Ie, you must add the executorFilter after having added the codec filter.

For instance, if you want an executor for the incoming requests and another for the outgoing, someting like :
chain.addLast( readExecutor )
chain.addLast( codec )
chain.addLast( writeExecutor )
should work. (this is because the write operation walk the chain from tail to head).

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to