In relation to this, I have just checked in some changes to the Cache
interface - new API methods + javadocs explaining how to use them.
Please have a look and feedback. Note that the impl isn't in place
yet, but this is how I see it happening:
1. Cache delegate adds a flag on to the invocation context that a
Future is needed, and calls the *regular* API method.
2. The BaseRPCInterceptor usually makes either sync or async RPC
calls based on overall config plus override flags. It will now also
look for this Future flag on the context, and if it is set, perform
the RPC as a *sync* call, but in a separate thread, and return a Future.
3. Will use the same async executor that async calls use for
asynchronous marshalling.
Thoughts? This will mean only the RPC is taken offline (including
marshalling). Locking, etc. happens on the thread's context for the
various reasons outlined below.
Cheers
Manik
On 5 May 2009, at 14:23, Manik Surtani wrote:
Picking up on
https://jira.jboss.org/jira/browse/ISPN-72
I was thinking about from what point the call is placed on a
separate thread. The obvious bit is the network stack so that the
caller gets a Future before the call goes out on the network, but
maybe there is sense to do this even earlier? Perhaps as soon as
the invocation is made? Things to consider though are transaction
context - which exist on the caller's thread - and potential context
class loaders on the thread. Stuff that can be dealt with easily
enough - e.g., if we have an AsyncInterceptor that handles the
thread pooling and management of the Future, and this sits *after*
the TxInterceptor so transaction participation is already determined
and transaction context attached to the call. Context classloaders
and the like could be attached to the worker thread that then
carries the call down the chain and to the wire.
Thoughts?
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org