Reputation: 2121
I've Guava in my Classpath and want to use ListenableFuture
s, but currently I don't know how to submit ListenableFuture
s or is it currently only possible to use them without an executor in the calling thread? I've read that a decorator is available in r10 which isn't out?
I've found Futures.makeListenable(Future<V> future)
but I'm not sure if that's currently the only way how to use ListenableFuture
s.
kind regards,
Johannes
Upvotes: 2
Views: 1148
Reputation: 3962
We improved the ListenableFuture
Javadoc for the forthcoming r10, including adding information about how to obtain an instance of the class. You can see the HEAD version here: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/util/concurrent/ListenableFuture.html
The decorator method you're interested in is MoreExecutors.listeningDecorator
Upvotes: 3