ListenableFutureTask / ExecutorService
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(Futur开发者_如何学运维e<V> future)
but I'm not sure if that's currently the only way how to use ListenableFuture
s.
kind regards,
JohannesWe 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
精彩评论