/** * Combine the given CompletionStages into a single CompletionStage for the list of results. * * The sequencing operations are performed in the default ExecutionContext. * @param promises The CompletionStages to combine * @param <A> the type of the completion's result. * @return A single CompletionStage whose methods act on the list of redeemed CompletionStage */ @SafeVarargs static <A> CompletionStage<List<A>> sequence(CompletionStage<A>... promises) { return sequence(Arrays.asList(promises)); } }
/** * Combine the given CompletionStages into a single CompletionStage for the list of results. * * The sequencing operations are performed in the default ExecutionContext. * @param promises The CompletionStages to combine * @param <A> the type of the completion's result. * @return A single CompletionStage whose methods act on the list of redeemed CompletionStage */ @SafeVarargs static <A> CompletionStage<List<A>> sequence(CompletionStage<A>... promises) { return sequence(Arrays.asList(promises)); } }
/** * Combine the given CompletionStages into a single CompletionStage for the list of results. * * The sequencing operations are performed in the default ExecutionContext. * @param promises The CompletionStages to combine * @param <A> the type of the completion's result. * @return A single CompletionStage whose methods act on the list of redeemed CompletionStage */ @SafeVarargs static <A> CompletionStage<List<A>> sequence(CompletionStage<A>... promises) { return sequence(Arrays.asList(promises)); } }
/** * Combine the given promises into a single promise for the list of results. * <p> * The sequencing operations are performed in the default ExecutionContext. * * @param promises The promises to combine * @return A single promise whose methods act on the list of redeemed promises * Use {@link Futures#sequence(Iterable)} instead. */ public static <A> Promise<List<A>> sequence(Iterable<Promise<A>> promises) { return wrap(Futures.sequence(promises)); }
/** * Combine the given promises into a single promise for the list of results. * <p> * The sequencing operations are performed in the default ExecutionContext. * * @param promises The promises to combine * @return A single promise whose methods act on the list of redeemed promises * Use {@link Futures#sequence(CompletionStage[])} instead. */ public static <A> Promise<List<A>> sequence(Promise<A>... promises) { return wrap(Futures.sequence(Arrays.asList(promises))); }