开发者

ListenableFutureTask / ExecutorService

开发者 https://www.devze.com 2023-04-07 01:24 出处:网络
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 calli

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(Futur开发者_如何学运维e<V> future) but I'm not sure if that's currently the only way how to use ListenableFutures.

kind regards,

Johannes


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

0

精彩评论

暂无评论...
验证码 换一张
取 消