Package com.yahoo.concurrent
Class CompletableFutures
- java.lang.Object
-
- com.yahoo.concurrent.CompletableFutures
-
public class CompletableFutures extends Object
Helper forCompletableFuture
/CompletionStage
.- Author:
- bjorncs
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> CompletableFuture<List<T>>
allOf(List<CompletableFuture<T>> futures)
Similar toCompletableFuture.allOf(CompletableFuture[])
but returns a list of the resultsstatic <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 exceptionallystatic <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 8static <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
-
-
-
Method Detail
-
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 toCompletableFuture.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 8Helper for migrating fromListenableFuture
toCompletableFuture
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 8Helper for migrating fromListenableFuture
toCompletableFuture
in Vespa public apis
-
-