Class JdkFutureAdapters


  • @GwtIncompatible
    public final class JdkFutureAdapters
    extends java.lang.Object
    Utilities necessary for working with libraries that supply plain Future instances. Note that, whenever possible, it is strongly preferred to modify those libraries to return ListenableFuture directly.

    For interoperability between ListenableFuture and CompletableFuture, consider Future Converter.

    Since:
    10.0 (replacing Futures.makeListenable, which existed in 1.0)
    Author:
    Sven Mawson
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V extends @Nullable java.lang.Object>
      ListenableFuture<V>
      listenInPoolThread​(java.util.concurrent.Future<V> future)
      Assigns a thread to the given Future to provide ListenableFuture functionality.
      static <V extends @Nullable java.lang.Object>
      ListenableFuture<V>
      listenInPoolThread​(java.util.concurrent.Future<V> future, java.util.concurrent.Executor executor)
      Submits a blocking task for the given Future to provide ListenableFuture functionality.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait