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.
  • Constructor Details

    • ThriftListenableFuture

      public ThriftListenableFuture()
  • Method Details

    • completedFuture

      public static <T> ThriftListenableFuture<T> completedFuture(@Nullable T value)
      Returns a new ThriftListenableFuture instance that has its value set immediately.
    • exceptionallyCompletedFuture

      public static <T> ThriftListenableFuture<T> exceptionallyCompletedFuture(Throwable cause)
      Returns a new ThriftListenableFuture instance that has an exception set immediately.
    • onComplete

      public void onComplete(@Nullable T value)
      Specified by:
      onComplete in interface org.apache.thrift.async.AsyncMethodCallback<T>
    • onError

      public void onError(Exception cause)
      Specified by:
      onError in interface org.apache.thrift.async.AsyncMethodCallback<T>