Skip to content

Instance Method

append(_:runningOn:)

An overload for append(generator:runningOn:) that takes in an EventLoopFuture as an auto closure to provide a better 1-liner API.
func append<Value>(_ generator: @autoclosure @escaping () -> EventLoopFuture<Value>, runningOn next: EventLoopFutureQueue.ContinueCondition = .complete) -> EventLoopFuture<Value>

Parameters

generator

The statement that will produce an EventLoopFuture. This will automatically get wrapped in a closure.

next

The condition that the previous future(s) must meet on their completion for the appended future to be run. The default value is .complete.

Return Value

The future passed into the generator parameter.

Discussion

let model: EventLoopFuture<Model> = queue.append(Model.query(on: database).first())