I've been recently dealing with Meteor (kind of legacy) code. I know the backend code makes (type wise) blocking calls to Mongo, but I have been told these calls work on fibers. From what I've seen these code running on fibers looks exactly the same as blocking code. I've been told it's ok, but I want to know how that's achieved. I come from a Scala background and I know fibers need some kind of suspending mechanism that allows computations to stand by until some result becomes available. That's not possible in classical blocking code. (In the case of Scala, flatmap separates computation from callback)
In other words... What does Meteor.bindEnvironment do?
That could be possible using async/await, or generators/yield.. but other than that? How? How do meteor fibers work? How can they avoid blocking the only available thread when making I/O operations like HTTP or using the file system?