Instance Method
mapEach(_:)
Gets the value of a key path for each element in the sequence that is wrapped by an
EventLoopFuture.func mapEach<Result>(_ keyPath: KeyPath<Value.Element, Result>) -> EventLoopFuture<[Result]>
Parameters
keyPathThe key path to access on each element in the sequence.
Return Value
A new EventLoopFuture that wraps the sequence of key path values.
Discussion
let collection = eventLoop.future(["a", "bb", "ccc", "dddd", "eeeee"])
let lengths = collection.mapEach(\.count)
// lengths: EventLoopFuture([1, 2, 3, 4, 5])