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 com.linecorp.armeria.common.util.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
Constructors Constructor Description ThriftFuture() -
Method Summary
Modifier and Type Method Description static <T> ThriftFuture<T>completedFuture(T value)Returns a newThriftFutureinstance that has its value set immediately.static <T> ThriftFuture<T>exceptionallyCompletedFuture(Throwable cause)Returns a newThriftFutureinstance that has an exception set immediately.voidonComplete(T value)voidonError(Exception cause)Methods inherited from class com.linecorp.armeria.common.util.EventLoopCheckingFuture
get, get, joinMethods 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 newThriftFutureinstance that has its value set immediately. -
exceptionallyCompletedFuture
Returns a newThriftFutureinstance that has an exception set immediately. -
onComplete
- Specified by:
onCompletein interfaceAsyncMethodCallback<T>
-
onError
- Specified by:
onErrorin interfaceAsyncMethodCallback<T>
-