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 thisRpcResponsecompleted exceptionally.static RpcResponsefrom(CompletionStage<?> stage) Creates a newRpcResponsethat is completed successfully or exceptionally based on the completion of the specifiedCompletionStage.Returns the specifiedvalueIfAbsentwhen not complete, or returns the result value or throws an exception when complete.booleanReturnstrueif thisRpcResponsecompleted exceptionally.join()Returns the result value if completed successfully or throws an unchecked exception if completed exceptionally.static RpcResponseReturns a newly created successfully completeRpcResponse.static RpcResponseReturns a newly created exceptionally completeRpcResponse.default CompletableFuture<?>Returns aCompletableFuturewhich completes when thisRpcResponsecompletes.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, whenCompleteAsyncMethods 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 newRpcResponsethat 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 specifiedvalueIfAbsentwhen not complete, or returns the result value or throws an exception when complete.- See Also:
-
cause
Returns the cause of the failure if thisRpcResponsecompleted exceptionally.- Returns:
- the cause, or
nullif thisRpcResponsecompleted successfully or did not complete yet.
-
isCompletedExceptionally
boolean isCompletedExceptionally()Returnstrueif thisRpcResponsecompleted exceptionally. -
whenComplete
Returns aCompletableFuturewhich completes when thisRpcResponsecompletes.- Specified by:
whenCompletein interfaceResponse
-