mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation:
`ELF.whenAllComplete` is a "fail slow" method that returns an `EventLoopFuture` that always succeeds after all provided futures complete - fulfilling with all the results of the futures.
`ELF.whenAllSucceed` is a "fail fast" method that returns an `EventLoopFuture` that succeeds if all of the futures succeed - and returning the fulfilled values.
This new method acts as a counterpart to both `ELF.whenAllComplete` and `andAll`
Modifications:
Add `ELF.whenAllSucceed` that returns an EventLoopFuture with all of the values provided from the futures being awaited.
Rename `ELF.whenAllComplete(_:eventLoop:)` to `ELF.whenAllComplete(_🔛)` to match new `whenAllSucceed` and Swift API guidelines
Result:
New method for flattening multiple futures into a single EventLoopFuture that fulfills with an array of their success values if they all succeed.