2
我已經在我的Classpath中使用Guava,並且想要使用ListenableFuture
s,但是目前我不知道如何提交ListenableFuture
s,或者目前只能在調用線程中使用它們而沒有執行程序嗎?我讀過r10中有一個裝飾器沒有出來?ListenableFutureTask/ExecutorService
我發現Futures.makeListenable(Future<V> future)
,但我不確定這是目前如何使用ListenableFuture
s的唯一方法。
親切的問候,
約翰內斯
謝謝克里斯,我使用'Futures.makeListenable(未來未來)'直到R10可以(通過的Maven ;-))。我在一個循環中使用它,儘管我認爲使用靜態包裝器方法是不可能的。起初我找不到「ListenableExecutorService」或適當的方法。再次感謝。 –
Johannes