Class
EventLoopFutureQueue
Allows you to queue closures that produce an
EventLoopFuture, so each future only gets run if the previous ones complete, succeed, or fail.final class EventLoopFutureQueue
Topics
Initializers
init(eventLoop:)Create a newEventLoopFutureQueueon a given event loop.
Instance Properties
eventLoopThe event loop that all the futures’s completions are handled on.
Instance Methods
append(_:runningOn:)An overload forappend(generator:runningOn:)that takes in anEventLoopFutureas an auto closure to provide a better 1-liner API.append(each:_:)For each element of the provided collection, invoke the given generator and queue the returned future. Return a future whose value is an array containing the result of each generated future in the same order as the original sequence. The resulting array is intended to have semantics substantially similar to those provided byEventLoop.flatten(_:on:).append(onPrevious:generator:)Adds anotherEventLoopFutureproducing closure to be run as soon as all previously queued future have completed, succeeded, or failed.
Enumerations
EventLoopFutureQueue.ContinueConditionUnder what conditions an appended closure should be run.EventLoopFutureQueue.ContinueErrorErrors that get propogated based on a future’s completion status and the next appended closure’s continuation condition.
See Also
EventLoopFuture
mapEach(_:)Gets the value of a key path for each element in the sequence that is wrapped by anEventLoopFuture.mapEach(_:)Calls a closure on each element in the sequence that is wrapped by anEventLoopFuture.mapEachCompact(_:)Gets the optional value of a key path for each element in the sequence that is wrapped by anEventLoopFuture.mapEachCompact(_:)Calls a closure, which returns anOptional, on each element in the sequence that is wrapped by anEventLoopFuture.mapEachFlat(_:)Gets the collection value of a key path for each element in the sequence that is wrapped by anEventLoopFuture, combining the results into a single result collection.mapEachFlat(_:)Calls a closure which returns a collection on each element in the sequence that is wrapped by anEventLoopFuture, combining the results into a single result collection.flatMapEach(on:_:)Calls a closure, which returns anEventLoopFuture, on each element in a sequence that is wrapped by anEventLoopFuture. No results from each future are expected.flatMapEach(on:_:)Calls a closure, which returns anEventLoopFuture, on each element in a sequence that is wrapped by anEventLoopFuture.flatMapEachCompact(on:_:)Calls a closure, which returns anEventLoopFuture<Optional>, on each element in a sequence that is wrapped by anEventLoopFuture.flatMapEachThrowing(_:)Calls a closure on each element in the sequence that is wrapped by anEventLoopFuture.flatMapEachCompactThrowing(_:)Calls a closure, which returns anOptional, on each element in the sequence that is wrapped by anEventLoopFuture.sequencedFlatMapEach(_:)An overload ofsequencedFlatMapEach(_:)which returns aVoidfuture instead of[Void]when the result type of the transform closure isVoid.sequencedFlatMapEach(_:)A variant form offlatMapEach(on:_:)which guarantees:sequencedFlatMapEachCompact(_:)Variant ofsequencedFlatMapEach(_:)which providescompactMap()semantics by allowing result values to benil. Such results are not included in the output array.whenTheySucceed(_:_:file:line:)Returns a newEventLoopFuturethat succeeds only if all of the provided fs succeed. The newEventLoopFuturewill contain all of the values fulfilled by the fs.