Module dev.mccue.guava.concurrent
Package dev.mccue.guava.concurrent
Interface FutureCallback<V extends @Nullable Object>
public interface FutureCallback<V extends @Nullable Object>
A callback for accepting the results of a
Future computation
asynchronously.
To attach to a ListenableFuture use Futures.addCallback(dev.mccue.guava.concurrent.ListenableFuture<V>, dev.mccue.guava.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor).
- Since:
- 10.0
- Author:
- Anthony Zana
-
Method Summary
-
Method Details
-
onSuccess
Invoked with the result of theFuturecomputation when it is successful. -
onFailure
Invoked when aFuturecomputation fails or is canceled.If the future's
getmethod throws anExecutionException, then the cause is passed to this method. Any other thrown object is passed unaltered.
-