Class ThriftListenableFuture<T>
java.lang.Object
com.google.common.util.concurrent.internal.InternalFutureFailureAccess
com.google.common.util.concurrent.AbstractFuture<T>
com.linecorp.armeria.common.thrift.ThriftListenableFuture<T>
- All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<T>,Future<T>,AsyncMethodCallback<T>
public final class ThriftListenableFuture<T>
extends com.google.common.util.concurrent.AbstractFuture<T>
implements AsyncMethodCallback<T>
A
ListenableFuture that can be passed in as an AsyncMethodCallback
when making an asynchronous client-side Thrift RPC.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ThriftListenableFuture<T>completedFuture(T value) Returns a newThriftListenableFutureinstance that has its value set immediately.static <T> ThriftListenableFuture<T>Returns a newThriftListenableFutureinstance that has an exception set immediately.voidonComplete(T value) voidMethods inherited from class com.google.common.util.concurrent.AbstractFuture
addListener, afterDone, cancel, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
-
Constructor Details
-
ThriftListenableFuture
public ThriftListenableFuture()
-
-
Method Details
-
completedFuture
Returns a newThriftListenableFutureinstance that has its value set immediately. -
exceptionallyCompletedFuture
Returns a newThriftListenableFutureinstance that has an exception set immediately. -
onComplete
- Specified by:
onCompletein interfaceAsyncMethodCallback<T>
-
onError
- Specified by:
onErrorin interfaceAsyncMethodCallback<T>
-