mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
* Add EventLoopFuture reduce(initialResult:) function (#240) Motivation: Add a new function to allow us to work with multiple EventLoopFutures, that return values, by combining their results and wrapping it in a new EventLoopFuture, using a specified reducer function. Modifications: - Add a new function EventLoopFuture<T>.reduce<U>(initialResult:futures:eventLoop:nextPartialResult) - Changed the implementation of andAll<Void> to use EventLoopFuture<Void>.reduce(initialResult) - Add a new function EventLoopFuture<T>.reduce<U>(into:) Result: Can reduce multiple EventLoopFutures without having to deal with creating EventLoopFutures. Simplified EventLoopFuture andAll<Void> - An API which can be used to construct collections from future values in a linear time.