Coroutines and async/await 152 One thing to note here is that our main function is just a regular main function. The loop in our main function is what drives the asynchronous operations to completion: ch07/a-coroutine/src/main. rs fn main() { let mut future = async_main(); loop { match future. poll() { Poll State::Not Ready => { println!("Schedule other tasks"); }, Poll State::Ready(_) => break, } thread::sleep(Duration::from_millis(100)); } } This function is very simple. We first get the future returned from async_main and then we call poll on it in a loop until it returns Poll State::Ready. Every time we receive a Poll State::Not Ready in return, the control is yielded back to us. we could do other work here, such as scheduling another task, if we want to, but in our case, we just print Schedule other tasks. We also limit how often the loop is run by sleeping for 100 milliseconds on every call. This way we won't be overwhelmed with printouts and we can assume that there are roughly 100 milliseconds between every time we see "Schedule other tasks" printed to the console. If we run the example, we get this output: Program starting FIRST POLL-START OPERATION Schedule other tasks Schedule other tasks Schedule other tasks Schedule other tasks Schedule other tasks Schedule other tasks HTTP/1. 1 200 OK content-length: 11 connection: close content-type: text/plain; charset=utf-8 date: Tue, 24 Oct 2023 20:39:13 GMT Hello World1 FIRST POLL-START OPERATION