[infinispan-dev] Sequential interceptors API
Radim Vansa
rvansa at redhat.com
Wed Jun 8 08:23:48 EDT 2016
Hi,
I would like to encourage you to play with the (relatively) new API for
sequential interceptors, and voice your comments - especially you corish
devs, and Galder who has much experience with async invocations and that
kind of stuff from JS-world.
I am now trying to use the asynchronous methods only (the
forkInvocationSync() is only temporary helper!); Dan has made it this
way as he wanted to avoid unnecessary allocations, and I welcome this
GC-awareness, but regrettably I find it rather hard to use, due to its
handler-style nature. For the simplest style interceptors (do this,
invoke next interceptor, and process result) it's fine, but when you
want to do something like:
visitFoo(cmd) {
Object x = null;
if (/* ... */) {
x = invoke(new OtherCommand());
}
invoke(new DifferentCommand(x));
Object retval = invoke(cmd);
return wrap(retval);
}
I find myself passing handlers deep down. There is allocation cost for
closures, so API that does not allocate CompletableFutures does not pay off.
I don't say that I could improve it (I have directed my comments to Dan
on IRC when I had something in particular), I just say that this is very
important API for further Infinispan development and everyone should pay
attention before it gets final.
So please, play with it, and show your opinion.
Radim
--
Radim Vansa <rvansa at redhat.com>
JBoss Performance Team
More information about the infinispan-dev
mailing list