public interface RpcResponse extends Response, Future<Object>, CompletionStage<Object>
Response. It is a CompletionStage whose result signifies the return value of an RPC
call.| Modifier and Type | Method and Description |
|---|---|
Throwable |
cause()
Returns the cause of the failure if this
RpcResponse completed exceptionally. |
static RpcResponse |
from(CompletionStage<?> stage)
Creates a new
RpcResponse that is completed successfully or exceptionally based on the
completion of the specified CompletionStage. |
Object |
getNow(Object valueIfAbsent)
Returns the specified
valueIfAbsent when not complete, or
returns the result value or throws an exception when complete. |
boolean |
isCompletedExceptionally()
Returns
true if this RpcResponse completed exceptionally. |
Object |
join()
Returns the result value if completed successfully or
throws an unchecked exception if completed exceptionally.
|
static RpcResponse |
of(Object value)
Creates a new successfully complete
RpcResponse. |
static RpcResponse |
ofFailure(Throwable cause)
Creates a new exceptionally complete
RpcResponse. |
default CompletableFuture<?> |
whenComplete()
Returns a
CompletableFuture which completes when this RpcResponse completes. |
closeFuture, completionFutureacceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsyncstatic RpcResponse of(Object value)
RpcResponse.static RpcResponse ofFailure(Throwable cause)
RpcResponse.static RpcResponse from(CompletionStage<?> stage)
RpcResponse that is completed successfully or exceptionally based on the
completion of the specified CompletionStage.Object join()
CompletableFuture.join()Object getNow(Object valueIfAbsent)
valueIfAbsent when not complete, or
returns the result value or throws an exception when complete.CompletableFuture.getNow(Object)Throwable cause()
RpcResponse completed exceptionally.null if this RpcResponse completed successfully or did not complete yet.boolean isCompletedExceptionally()
true if this RpcResponse completed exceptionally.default CompletableFuture<?> whenComplete()
CompletableFuture which completes when this RpcResponse completes.whenComplete in interface ResponseCopyright © 2020 LeanCloud. All rights reserved.