Instance Method
nonemptyMap(_:)
Checks that the future’s value (if any) returns
false for .isEmpty. If the check fails, a new future with an empty array as its value is returned. Otherwise, the provided normal map() callback is invoked. The callback’s return type must be an Array or a RangeReplaceableCollection.func nonemptyMap<NewValue>(_ transform: @escaping (Value) -> NewValue) -> EventLoopFuture<NewValue> where Value : Collection, NewValue : RangeReplaceableCollection
See Also
EventLoopFuture
class EventLoopFutureQueueAllows you to queue closures that produce anEventLoopFuture, so each future only gets run if the previous ones complete, succeed, or fail.func mapEach<Result>(KeyPath<Value.Element, Result>) -> EventLoopFuture<[Result]>Gets the value of a key path for each element in the sequence that is wrapped by anEventLoopFuture.func mapEach<Result>((Value.Element) -> Result) -> EventLoopFuture<[Result]>Calls a closure on each element in the sequence that is wrapped by anEventLoopFuture.func mapEachCompact<Result>(KeyPath<Value.Element, Result?>) -> EventLoopFuture<[Result]>Gets the optional value of a key path for each element in the sequence that is wrapped by anEventLoopFuture.func mapEachCompact<Result>((Value.Element) -> Result?) -> EventLoopFuture<[Result]>Calls a closure, which returns anOptional, on each element in the sequence that is wrapped by anEventLoopFuture.func mapEachFlat<ResultSegment>(KeyPath<Value.Element, ResultSegment>) -> EventLoopFuture<[ResultSegment.Element]>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.func mapEachFlat<ResultSegment>((Value.Element) -> ResultSegment) -> EventLoopFuture<[ResultSegment.Element]>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.func flatMapEach(on: any EventLoop, (Value.Element) -> EventLoopFuture<Void>) -> EventLoopFuture<Void>Calls a closure, which returns anEventLoopFuture, on each element in a sequence that is wrapped by anEventLoopFuture. No results from each future are expected.func flatMapEach<Result>(on: any EventLoop, (Value.Element) -> EventLoopFuture<Result>) -> EventLoopFuture<[Result]>Calls a closure, which returns anEventLoopFuture, on each element in a sequence that is wrapped by anEventLoopFuture.func flatMapEachCompact<Result>(on: any EventLoop, (Value.Element) -> EventLoopFuture<Result?>) -> EventLoopFuture<[Result]>Calls a closure, which returns anEventLoopFuture<Optional>, on each element in a sequence that is wrapped by anEventLoopFuture.func flatMapEachThrowing<Result>((Value.Element) throws -> Result) -> EventLoopFuture<[Result]>Calls a closure on each element in the sequence that is wrapped by anEventLoopFuture.func flatMapEachCompactThrowing<Result>((Value.Element) throws -> Result?) -> EventLoopFuture<[Result]>Calls a closure, which returns anOptional, on each element in the sequence that is wrapped by anEventLoopFuture.func sequencedFlatMapEach((Value.Element) -> EventLoopFuture<Void>) -> EventLoopFuture<Void>An overload ofsequencedFlatMapEach(_:)which returns aVoidfuture instead of[Void]when the result type of the transform closure isVoid.func sequencedFlatMapEach<Result>((Value.Element) -> EventLoopFuture<Result>) -> EventLoopFuture<[Result]>A variant form offlatMapEach(on:_:)which guarantees:func sequencedFlatMapEachCompact<Result>((Value.Element) -> EventLoopFuture<Result?>) -> EventLoopFuture<[Result]>Variant ofsequencedFlatMapEach(_:)which providescompactMap()semantics by allowing result values to benil. Such results are not included in the output array.