I wonder if in a couple of years we'll be able to do: async fn main -> Result<(), Error> { // n-cpu event loop started in the background await foo()?; await bar()?; Ok(()) } Event loops require a bunch of boilerplate rn. Wonder if this eventually could be made easier.
Prerequisites: stable async/await, stable generators, (parts of tokio) in the stdlib. My guess anything along these lines couldn't be introduced until ~2020. But it's fun to think about what it could be like :D Maybe as an experiment: #[async] fn main -> Result<(), Error> { }