Class Futures
java.lang.Object
io.atomix.client.utils.concurrent.Futures
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CompletableFuture<List<T>>allOf(List<CompletableFuture<T>> futures) Returns a new CompletableFuture completed with a list of computed values when all of the given CompletableFuture complete.static <T> CompletableFuture<T>allOf(List<CompletableFuture<T>> futures, BinaryOperator<T> reducer, T emptyValue) Returns a new CompletableFuture completed by reducing a list of computed values when all of the given CompletableFuture complete.static <T> CompletableFuture<Stream<T>>allOf(Stream<CompletableFuture<T>> futures) Returns a new CompletableFuture completed with a list of computed values when all of the given CompletableFuture complete.
-
Constructor Details
-
Futures
public Futures()
-
-
Method Details
-
allOf
Returns a new CompletableFuture completed with a list of computed values when all of the given CompletableFuture complete.- Type Parameters:
T- value type of CompletableFuture- Parameters:
futures- the CompletableFutures- Returns:
- a new CompletableFuture that is completed when all of the given CompletableFutures complete
-
allOf
Returns a new CompletableFuture completed with a list of computed values when all of the given CompletableFuture complete.- Type Parameters:
T- value type of CompletableFuture- Parameters:
futures- the CompletableFutures- Returns:
- a new CompletableFuture that is completed when all of the given CompletableFutures complete
-
allOf
public static <T> CompletableFuture<T> allOf(List<CompletableFuture<T>> futures, BinaryOperator<T> reducer, T emptyValue) Returns a new CompletableFuture completed by reducing a list of computed values when all of the given CompletableFuture complete.- Type Parameters:
T- value type of CompletableFuture- Parameters:
futures- the CompletableFuturesreducer- reducer for computing the resultemptyValue- zero value to be returned if the input future list is empty- Returns:
- a new CompletableFuture that is completed when all of the given CompletableFutures complete
-