# untokio: pretend tokio doesn't exist [![GitHub](https://img.shields.io/github/stars/MaulingMonkey/untokio.svg?label=GitHub&style=social)](https://github.com/MaulingMonkey/untokio) [![crates.io](https://img.shields.io/crates/v/untokio.svg)](https://crates.io/crates/untokio) [![docs.rs](https://docs.rs/untokio/badge.svg)](https://docs.rs/untokio) [![License](https://img.shields.io/crates/l/untokio.svg)](https://github.com/MaulingMonkey/untokio) [![Build Status](https://github.com/MaulingMonkey/untokio/workflows/Rust/badge.svg)](https://github.com/MaulingMonkey/untokio/actions?query=workflow%3Arust) Do you struggle with any of the following symptoms? * Ennui triggered by the thought of inflicting tokio::main or tokio runtime management on users of your library * Indecision about what runtime configuration you should use for **your** runtimes? * `thread 'main' panicked at 'not currently running on the Tokio runtime.'` Struggle no more, with `untokio`! `untokio` will automatically create a runtime so you don't have to. ## [example](examples/example02.rs): tokio = "0.2", reqwest = "0.10" ```toml [dependencies] untokio = { version = "0.2", features = ["v02"] } ``` ```rust untokio::v02::spawn(async { // code requiring a tokio 0.2 runtime reqwest::get("http://example.com/").await?.text().await }).await.unwrap() ``` ## [example](examples/example03.rs): tokio = "0.3" ```toml [dependencies] untokio = { version = "0.2", features = ["v03"] } ``` ```rust untokio::v03::spawn(async{ // code requiring a tokio 0.3 runtime tokio::fs::read_to_string("Cargo.toml").await }).await.unwrap() ``` ## [example](examples/example1.rs): tokio = "1" ```toml [dependencies] untokio = { version = "0.2", features = ["v1"] } ``` ```rust untokio::v1::spawn(async{ // code requiring a tokio 1.x runtime tokio::fs::read_to_string("Cargo.toml").await }).await.unwrap() ```