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. |
default CompletableFuture<?> |
completionFuture()
Returns a
CompletableFuture which completes when this RpcResponse completes. |
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 . |
closeFuture
acceptEither, 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, whenCompleteAsync
static RpcResponse of(@Nullable 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<?> completionFuture()
CompletableFuture
which completes when this RpcResponse
completes.completionFuture
in interface Response
© Copyright 2015–2017 LINE Corporation. All rights reserved.