Package com.yahoo.concurrent
Class CompletableFutures
java.lang.Object
com.yahoo.concurrent.CompletableFutures
Helper for
CompletableFuture
/ CompletionStage
.- Author:
- bjorncs
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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 Details
-
firstOf
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
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
-