V - the type of the expected value to be computed by the Promisepublic interface CompletionHandler<V>
Promise to be notified once a value is available or when the
computation failed.| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(Throwable throwable)
Invoked if the promise is fails with the given throwable.
|
void |
onSuccess(V value)
Invoked if the promise is successfully completed with the given value.
|
void onSuccess(@Nullable V value) throws Exception
value - the computed value of the promise.Exception - simplifies exception handling as each error is either passed on to the next promise or logged
via Exceptions.handle()void onFailure(@Nonnull Throwable throwable) throws Exception
throwable - the thrown error which occurred while computing the promised value.Exception - simplifies exception handling as each error is either passed on to the next promise or logged
via Exceptions.handle()Copyright © 2018. All rights reserved.