Interface FutureCallback<V>
-
@GwtCompatible public interface FutureCallback<V>
A callback for accepting the results of a computation asynchronously.To attach to a
ListenableFuture
useFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
.- Since:
- 10.0
- Author:
- Anthony Zana
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
t)
Invoked when aFuture
computation fails or is canceled.void
V result)
Invoked with the result of theFuture
computation when it is successful.
-
-
-
Method Detail
-
onSuccess
void V result)
Invoked with the result of theFuture
computation when it is successful.
-
onFailure
void t)
Invoked when aFuture
computation fails or is canceled.If the future's method throws an , then the cause is passed to this method. Any other thrown object is passed unaltered.
-
-