Module untokio::v03[][src]

tokio = “0.3spawn, runtime, try_set_runtime, set_runtime

Example

mod library {
    pub async fn read() -> Result<String, std::io::Error> {
        untokio::v03::spawn(async{
            tokio03::fs::read_to_string("Cargo.toml").await
        }).await.unwrap()
    }
}

println!("{}", futures::executor::block_on(library::read()).unwrap());

Functions

runtime

Get untokio’s Runtime

set_runtime

Provide a Runtime instead of letting untokio create its own.

spawn

Spawns a new asynchronous task, returning a JoinHandle for it.

try_set_runtime

Provide a Runtime instead of letting untokio create its own.