[infinispan-dev] Sequential interceptors API

Galder Zamarreño galder at redhat.com
Fri Jun 17 04:52:52 EDT 2016

Radim, do you have a branch where you have been trying these things out? I'd like to play with what you're trying to do.

Galder Zamarreño
Infinispan, Red Hat

> On 8 Jun 2016, at 14:23, Radim Vansa <rvansa at redhat.com> wrote:
> 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
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

More information about the infinispan-dev mailing list