Package com.linecorp.armeria.common
Interface RpcResponse
- All Superinterfaces:
CompletionStage<Object>
,Future<Object>
,Response
- All Known Implementing Classes:
CompletableRpcResponse
An RPC
Response
. It is a CompletionStage
whose result signifies the return value of an RPC
call.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Method Summary
Modifier and TypeMethodDescriptioncause()
Returns the cause of the failure if thisRpcResponse
completed exceptionally.static RpcResponse
from
(CompletionStage<?> stage) Creates a newRpcResponse
that is completed successfully or exceptionally based on the completion of the specifiedCompletionStage
.Returns the specifiedvalueIfAbsent
when not complete, or returns the result value or throws an exception when complete.boolean
Returnstrue
if thisRpcResponse
completed exceptionally.join()
Returns the result value if completed successfully or throws an unchecked exception if completed exceptionally.static RpcResponse
Returns a newly created successfully completeRpcResponse
.static RpcResponse
Returns a newly created exceptionally completeRpcResponse
.default CompletableFuture<?>
Returns aCompletableFuture
which completes when thisRpcResponse
completes.Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, 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
Methods inherited from interface java.util.concurrent.Future
cancel, exceptionNow, get, get, isCancelled, isDone, resultNow, state
-
Method Details
-
of
Returns a newly created successfully completeRpcResponse
. -
ofFailure
Returns a newly created exceptionally completeRpcResponse
. -
from
Creates a newRpcResponse
that is completed successfully or exceptionally based on the completion of the specifiedCompletionStage
. -
join
Object join()Returns the result value if completed successfully or throws an unchecked exception if completed exceptionally.- See Also:
-
getNow
Returns the specifiedvalueIfAbsent
when not complete, or returns the result value or throws an exception when complete.- See Also:
-
cause
Returns the cause of the failure if thisRpcResponse
completed exceptionally.- Returns:
- the cause, or
null
if thisRpcResponse
completed successfully or did not complete yet.
-
isCompletedExceptionally
boolean isCompletedExceptionally()Returnstrue
if thisRpcResponse
completed exceptionally. -
whenComplete
Returns aCompletableFuture
which completes when thisRpcResponse
completes.- Specified by:
whenComplete
in interfaceResponse
-