When working with Vapor, I recently was surprised to learn that Future.map was 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-L280
Just checking that this wasn't an oversight, because the two methods appear to be very close in implementation.
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.