Skip to content

Instance Method

sequencedFlatMapEach(_:)

A variant form of flatMapEach(on:_:) which guarantees:
func sequencedFlatMapEach<Result>(_ transform: @escaping (Value.Element) -> EventLoopFuture<Result>) -> EventLoopFuture<[Result]>

Discussion

  1. Explicitly sequential execution of each future returned by the mapping closure; the next future does not being executing until the previous one has yielded a success result.

  2. No further futures will be even partially executed if any one future returns a failure result.

Neither of these are provided by the original version of the method.

See Also

EventLoopFuture