Johannes
Johannes

Reputation: 2121

ListenableFutureTask / ExecutorService

I've Guava in my Classpath and want to use ListenableFutures, but currently I don't know how to submit ListenableFutures 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 ListenableFutures.

kind regards,
Johannes

Upvotes: 2

Views: 1148

Answers (1)

Chris Povirk
Chris Povirk

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

Related Questions