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>
,org.apache.thrift.async.AsyncMethodCallback<T>
public final class ThriftListenableFuture<T>
extends com.google.common.util.concurrent.AbstractFuture<T>
implements org.apache.thrift.async.AsyncMethodCallback<T>
A
ListenableFuture
that can be passed in as an AsyncMethodCallback
when making an asynchronous client-side Thrift RPC.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ThriftListenableFuture<T>
completedFuture
(T value) Returns a newThriftListenableFuture
instance that has its value set immediately.static <T> ThriftListenableFuture<T>
Returns a newThriftListenableFuture
instance that has an exception set immediately.void
onComplete
(T value) void
Methods inherited from class com.google.common.util.concurrent.AbstractFuture
addListener, afterDone, cancel, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
ThriftListenableFuture
public ThriftListenableFuture()
-
-
Method Details
-
completedFuture
Returns a newThriftListenableFuture
instance that has its value set immediately. -
exceptionallyCompletedFuture
Returns a newThriftListenableFuture
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>
-