Class CompletableFutures

java.lang.Object
com.yahoo.concurrent.CompletableFutures

public class CompletableFutures extends Object
Author:
bjorncs
  • Method Details

    • firstOf

      public static <T> CompletableFuture<T> firstOf(List<CompletableFuture<T>> futures)
      Returns a new completable future that is either - completed when any of the provided futures complete without exception - completed exceptionally once all provided futures complete exceptionally
    • allOf

      public static <T> CompletableFuture<List<T>> allOf(List<CompletableFuture<T>> futures)
      Similar to CompletableFuture.allOf(CompletableFuture[]) but returns a list of the results
    • toGuavaListenableFuture

      @Deprecated(forRemoval=true, since="7") public static <V> com.google.common.util.concurrent.ListenableFuture<V> toGuavaListenableFuture(CompletableFuture<V> future)
      Deprecated, for removal: This API element is subject to removal in a future version.
      to be removed in Vespa 8
      Helper for migrating from ListenableFuture to CompletableFuture in Vespa public apis
    • toCompletableFuture

      @Deprecated(forRemoval=true, since="7") public static <V> CompletableFuture<V> toCompletableFuture(com.google.common.util.concurrent.ListenableFuture<V> guavaFuture)
      Deprecated, for removal: This API element is subject to removal in a future version.
      to be removed in Vespa 8
      Helper for migrating from ListenableFuture to CompletableFuture in Vespa public apis