Top Description Methods
com.google.common.util.concurrent

public Interface AsyncCallable<V extends @Nullable Object>

Annotations
@FunctionalInterface
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, java.util.concurrent.Future, org.checkerframework.checker.nullness.qual.Nullable

Computes a value, possibly asynchronously. For an example usage and more information, see Futures.FutureCombiner#callAsync(AsyncCallable, java.util.concurrent.Executor).

Much like java.util.concurrent.Callable, but returning a ListenableFuture result.

Since
20.0

Method Summary

Modifier and TypeMethod and Description
public ListenableFuture<V>
call()

Computes a result Future.

Method Detail

callback to summary
public ListenableFuture<V> call() throws Exception

Computes a result Future. The output Future need not be done, making AsyncCallable suitable for asynchronous derivations.

Throwing an exception from this method is equivalent to returning a failing ListenableFuture.