Hi! As I'm learning about async Rust, I read Build your own block_on() by @stjepang, and Applied: Build an Executor from "Asynchronous Programming in Rust." There's quite a bit of nuance in even these didactic implementations. What I'd like to know is: what is the simplest possible implementation of
block_on that will still drive any correct future to completion?
To make this easier, I'm thinking to add a few restrictions:
- The implementation does not need to care at all about performance.
- The implementation only needs to work in a single-threaded environment.
- The implementation can assume it's the only executor on the system, if that helps.
- The implementation doesn't need to support any kind of "spawn" functionality.
In this case I'm really only interested in a solution that's technically correct. The original motivation for this has been struggling to find a correct executor that will run on an embedded system.