public abstract static class Result.AbstractResult extends Object implements Result
Result.AbstractResult, Result.CompatibleResult| Constructor and Description |
|---|
AbstractResult() |
| Modifier and Type | Method and Description |
|---|---|
Result |
get() |
Result |
get(long timeout,
TimeUnit unit) |
void |
setValue(Object value) |
<U> CompletableFuture<U> |
thenApply(Function<Result,? extends U> fn) |
Result |
whenCompleteWithContext(BiConsumer<Result,Throwable> fn)
Add a callback which can be triggered when the RPC call finishes.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddObjectAttachments, getObjectAttachment, getObjectAttachment, getObjectAttachments, setException, setObjectAttachmentsaddAttachments, getAttachment, getAttachment, getAttachments, getException, getValue, hasException, recreate, setAttachment, setAttachment, setAttachments, setObjectAttachmentpublic Result whenCompleteWithContext(BiConsumer<Result,Throwable> fn)
Result
Just as the method name implies, this method will guarantee the callback being triggered under the same context as when the call was started,
see implementation in Result.whenCompleteWithContext(BiConsumer)
whenCompleteWithContext in interface Resultpublic <U> CompletableFuture<U> thenApply(Function<Result,? extends U> fn)
public Result get() throws InterruptedException, ExecutionException
get in interface ResultInterruptedExceptionExecutionExceptionpublic Result get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface ResultInterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.