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>
,org.apache.thrift.async.AsyncMethodCallback<T>
public final class ThriftFuture<T>
extends EventLoopCheckingFuture<T>
implements org.apache.thrift.async.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
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
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, exceptionNow, failedFuture, failedStage, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, resultNow, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, state, 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 interfaceorg.apache.thrift.async.AsyncMethodCallback<T>
-
onError
- Specified by:
onError
in interfaceorg.apache.thrift.async.AsyncMethodCallback<T>
-