This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
Future.map(on: worker) intentionally synchronous? #167
When working with Vapor, I recently was surprised to learn that
Future.mapwas a synchronous method that returns a future. I had been under the mistaken impression that it executed the closure on the event loop.Compare: https://github.com/vapor/core/blob/master/Sources/Async/Future%2BGlobal.swift#L11-L21
with
.submit: https://github.com/apple/swift-nio/blob/ae13d135f79e7b60281f9bf4c1cf1b3341a7339f/Sources/NIO/EventLoop.swift#L268-L280Just checking that this wasn't an oversight, because the two methods appear to be very close in implementation.