Coroutines and async/await 162 We set Output to String. This might strike you as strange since we don't actually return anything from this implementation. The reason is that corofy will only work with futures that return a String (it's one of its many, many shortcomings), so we just accept that and return an empty string on completion. Next up is our poll implementation. The first thing we do is to loop over each (flag, future) tuple: for (finished, fut) in self. futures. iter_mut() Inside the loop, we first check if the flag for this future is set to finished. If it is, we simply go to the next item in the collection. If it's not finished, we poll the future. If we get Poll State::Ready back, we set the flag for this future to true so that we won't poll it again and we increase the finished count. Note It's worth noting that the join_all implementation we create here will not work in any meaningful way with futures that return a value. In our case, we simply throw the value away, but remember, we're trying to keep this as simple as possible for now and the only thing we want to show is the concurrency aspect of calling join_all. Tokio's join_all implementation puts all the returned values in a Vec<T> and returns them when the Join All future resolves. If we get Poll State::Not Ready, we simply continue to the next future in the collection. After iterating through the entire collection, we check if we've resolved all the futures we originally received in if self. finished_count == self. futures. len(). If all our futures have been resolved, we return Poll State::Ready with an empty string (to make corofy happy). If there are still unresolved futures, we return Poll State::Not Ready. Important There is one subtle point to make a note of here. The first time Join All::poll is called, it will call poll on each future in the collection. Polling each future will kick off whatever operation they represent and allow them to progress concurrently. This is one way to achieve concurrency with lazy coroutines, such as the ones we're dealing with here. Next up are the changes we'll make in main. rs.