Package org.threadly.concurrent.future
Interface FutureCallback<T>
-
- Type Parameters:
T
- The result object type returned by this future
- All Known Implementing Classes:
SettableListenableFuture
public interface FutureCallback<T>
Callback for accepting the results of a future once the future has completed.- Since:
- 1.2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handleFailure(java.lang.Throwable t)
Called once a future has completed, but completed with either a failure or a cancellation.void
handleResult(T result)
Called once a result was produced successfully.
-
-
-
Method Detail
-
handleResult
void handleResult(T result)
Called once a result was produced successfully.- Parameters:
result
- Result that was provided from the future.
-
handleFailure
void handleFailure(java.lang.Throwable t)
Called once a future has completed, but completed with either a failure or a cancellation. If the original task threw an exception (and thus the future threw an ExecutionException), that original cause is provided here.If the future was canceled then a CancellationException will be provided.
- Parameters:
t
- Throwable representing the future failure.
-
-