`tokio::task::spawn()` schedules an async task on the Tokio runtime and returns a `JoinHandle`. Use it when a future should run as a separate task rather than waiting for it directly with `.await`. Spawning introduces concurrency and can permit parallel execution, but Tokio chooses where the task runs. section 8.5 section 8.4
Spawn and wait for completion
`fn start() -> tokio::task::JoinHandle<()> { tokio::task::spawn(async { println!("done"); }) }` An ordinary function can return the handle. From an async context, call `start().await` to wait for the task; retain the handle if you may need to abort it. section 8.4
Do not discard the handle when completion matters. A spawned task may not run before the program exits. Spawning also does not guarantee parallelism: with one worker thread, tasks run on that thread. Avoid blocking operations inside ordinary async tasks; use `tokio::task::spawn_blocking()` for blocking work. section 8.4 section 8.5
