[infinispan-dev] Async Notification API

Elias Ross genman at noderunner.net
Fri May 15 20:25:46 EDT 2009


Last iteration and I'm going for a beer.

On Fri, May 15, 2009 at 5:10 PM, Elias Ross <genman at noderunner.net> wrote:

> Now I think the "getter" might be better if it was more strongly typed:
>
> AsyncCache<ReturnType> c = cache.getAsyncCache(ReturnType.class);
>
> public interface AsyncCache<T> extends CompletionService<T> {
>  ... other methods go there.
> }

Ignore that :-) Make AsyncCache a class with all existing cache
operations, have them return Future. Don't have it "implement
CompletionService", simply add in poll() and take() methods from
CompletionService. Avoids the return type issue and avoids the kind of
strange builder method calls.

Then possibly have a notification registration method as a
convenience. Basically what it will do is pass completed Future
instances to it. How do you match the requests with the response?
Every request returns a Future. You basically can use reference
equality, or I guess, default "Object.equals" is fine.




More information about the infinispan-dev mailing list