2 ms·
Rust and JS have very very different execution models. You can absolutely control how many futures are allowed to make progress at the same time fully in usersp
by roblabla 7y ago
Rust and JS have very very different execution models. You can absolutely control how many futures are allowed to make progress at the same time fully in userspace. If you're joining N futures, and want to only allow M futures to make progress at a time, make an adapter that only calls the poll function of M futures at a time, until those futures call ready.
Rust gives you all the flexibility you need here. It might not be trivial yet because all the adapters might not be written yet, but that's purely a maturity problem.
The `join` macro does nothing magical. Go check out its implementation, and it will make it obvious how to implement a concurrency argument.