Geoff, I see two options:
a) you just install an ExecutorFilter add the end of your filter chain using the most appropriate Executor implementation. b) You apply the producer-consumer pattern. The IoHandler would be the producer: it adds all incoming requests and the IoSession to a BlockingQueue and the cache-layer would be the consumer: an Executor gets requests from the queue, processes it and writes the response to the IoSession. In fact, there is not too much difference between a) and b) except that in b) you are more in control and less tied to mina. Maarten On 7/13/07, Geoff Cadien <[EMAIL PROTECTED]> wrote:
On 7/12/07, mat <[EMAIL PROTECTED]> wrote: > > Please read the tutorial first and it is pretty good. > http://mina.apache.org/documentation.html#Documentation-Tutorials I have read the tutorials. :-) Maybe I should have been a little more clear. The only thing I found that seemed close was the ExecutorFilter, and I'm still not sure it is the solution I'm after. I currently have a reverse caching http proxy. In the current design, when a request is received the i/o handler calls the cache layer to retrieve the object. All interaction with the cache is asynchronous. The cache layer may or may have the object. If it has the object it returns it immediately. If it doesn't, it will itself make an http request to an origin server for the object. The cache layer maintains it's own pool of threads to handle connections to origin servers. If the object is being pulled from an origin the cache layer makes multiple call backs as it reads chunks so that it can start writing the response to the client. Now, I am willing to rework my design if there is a better way to do all of this within the Mina framework, I was simply looking for some pointers in the right direction because IMHO the documentation isn't that great. Thanks, -geoff
