I can't keep the first/last or head/tail sense straight for IoFilter
processing. Does the first/last labeling refer to the sending/outbound
perspective, with the first filter being the first to filter a write
and the last to filter a read, or is the first filter the last to
filter a write and the first to filter a read?

I ask because I'm not sure whether to put my ExecutorFilter at the
beginning or end of my filter chain. Right now I'm using this
arrangement (with some names changed):

,----
| // TODO: Figure out the ordering here:
| //       Should the thread pool be first or last?
| connector.getFilterChain().addLast( "my-codec",
|                                      new ProtocolCodecFilter(
|                                            new MyCodecFactory()) );
| connector.getFilterChain().addLast( "thread-pool",
|                                     new ExecutorFilter( executor ) );
| connector.setHandler( new MyProtocolHandler() );
`----

That makes the ExecutorFilter the "last" filter. But what does that
mean? Please advise.

-- 
Steven E. Harris

Reply via email to