Class Callables
java.lang.Object
com.google.common.util.concurrent.Callables
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends @Nullable Object>
AsyncCallable<T> asAsyncCallable
(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallable
from aCallable
.returning
(T value) Creates aCallable
which immediately returns a preset value each time it is called.
-
Method Details
-
returning
-
asAsyncCallable
@GwtIncompatible public static <T extends @Nullable Object> AsyncCallable<T> asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallable
from aCallable
.The
AsyncCallable
returns theListenableFuture
resulting fromListeningExecutorService.submit(Callable)
.- Since:
- 20.0
-