whenAllComplete(_:on:)

Returns a new EventLoopFuture that succeeds when all of the provided EventLoopFutures complete. The new EventLoopFuture will contain an array of results, maintaining ordering for each of the EventLoopFutures.

EventLoopFuture.swift:1564
@preconcurrency static func whenAllComplete(_ futures: [EventLoopFuture<Value>], on eventLoop: any EventLoop) -> EventLoopFuture<[Result<Value, any Error>]> where Value : Sendable

Parameters

futures

An array of homogenous EventLoopFutures to gather results from.

eventLoop

The EventLoop on which the new EventLoopFuture callbacks will fire.

Returns

A new EventLoopFuture with all the results of the provided futures.

The returned EventLoopFuture always succeeds, regardless of any failures from the waiting futures.

If it is desired to flatten them into a single EventLoopFuture that fails on the first EventLoopFuture failure, use one of the reduce methods instead.