What is the difference between tokio::spawn(my_future).await and just my_future.await?
One typically doesn’t await a spawned task (or at least not right away). It’s more common to simply write: tokio::spawn(my_future); Leave out the .await and the task will run in the background while the current task continues. Immediately calling .await blocks the current task. spawn(task).await is effectively no different than task.await. It’s akin to creating … Read more