Execute a task in a new thread and await the result asynchronously.
use std::{thread, time}; #[tokio::main] async fn main() { let output = thread_async::run(|| { thread::sleep(time::Duration::from_millis(250)); 42 }) .await; assert_eq!(output, 42); }