@GwtCompatible(emulated=true) public final class Callables extends Object
Callable
interface.Modifier and Type | Method and Description |
---|---|
static <T> AsyncCallable<T> |
asAsyncCallable(Callable<T> callable,
ListeningExecutorService listeningExecutorService)
Creates an
AsyncCallable from a Callable . |
static <T> Callable<T> |
returning(T value)
Creates a
Callable which immediately returns a preset value each time it is called. |
public static <T> Callable<T> returning(T value)
Callable
which immediately returns a preset value each time it is called.@Beta @GwtIncompatible public static <T> AsyncCallable<T> asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService)
AsyncCallable
from a Callable
.
The AsyncCallable
returns the ListenableFuture
resulting from ListeningExecutorService.submit(Callable)
.
Copyright © 2010–2018. All rights reserved.