Class ThriftFuture<T>
java.lang.Object
java.util.concurrent.CompletableFuture<T>
com.linecorp.armeria.common.util.EventLoopCheckingFuture<T>
com.linecorp.armeria.common.thrift.ThriftFuture<T>
- All Implemented Interfaces:
CompletionStage<T>
,Future<T>
,AsyncMethodCallback<T>
public final class ThriftFuture<T>
extends EventLoopCheckingFuture<T>
implements AsyncMethodCallback<T>
A
CompletableFuture
that can be passed in as an AsyncMethodCallback
when making an asynchronous client-side Thrift RPC.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ThriftFuture<T>
completedFuture
(T value) Returns a newThriftFuture
instance that has its value set immediately.static <T> ThriftFuture<T>
Returns a newThriftFuture
instance that has an exception set immediately.void
onComplete
(T value) void
Methods inherited from class com.linecorp.armeria.common.util.EventLoopCheckingFuture
get, get, join
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedFuture, failedStage, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Constructor Details
-
ThriftFuture
public ThriftFuture()
-
-
Method Details
-
completedFuture
Returns a newThriftFuture
instance that has its value set immediately. -
exceptionallyCompletedFuture
Returns a newThriftFuture
instance that has an exception set immediately. -
onComplete
- Specified by:
onComplete
in interfaceAsyncMethodCallback<T>
-
onError
- Specified by:
onError
in interfaceAsyncMethodCallback<T>
-