Interface AsyncCallable<V extends @Nullable Object>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @GwtCompatible public interface AsyncCallable<V extends @Nullable Object>
Computes a value, possibly asynchronously. For an example usage and more information, see Futures.FutureCombiner.callAsync(AsyncCallable, java.util.concurrent.Executor).

Much like Callable, but returning a ListenableFuture result.

Since:
20.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Computes a result Future.
  • Method Details

    • call

      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.

      Throws:
      Exception