java.lang.Object
com.google.common.util.concurrent.Callables
Static utility methods pertaining to the
Callable interface.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AsyncCallable<T>asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallablefrom aCallable.static <T> Callable<T>returning(T value) Creates aCallablewhich immediately returns a preset value each time it is called.
-
Method Details
-
returning
Creates aCallablewhich immediately returns a preset value each time it is called. -
asAsyncCallable
@Beta public static <T> AsyncCallable<T> asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallablefrom aCallable.The
AsyncCallablereturns theListenableFutureresulting fromListeningExecutorService.submit(Callable).- Since:
- 20.0
-