#tokio #async #networking #await #async-await #runtime

deprecated nightly tokio-async-await

Experimental async/await support for Tokio

8 releases

Uses old Rust 2015

0.1.7 Apr 22, 2019
0.1.6 Feb 23, 2019
0.1.5 Jan 7, 2019
0.1.4 Sep 27, 2018
0.1.1 Aug 27, 2018

#298 in #asynchronous

Download history 129/week @ 2022-10-12 106/week @ 2022-10-19 241/week @ 2022-10-26 263/week @ 2022-11-02 212/week @ 2022-11-09 229/week @ 2022-11-16 107/week @ 2022-11-23 130/week @ 2022-11-30 259/week @ 2022-12-07 114/week @ 2022-12-14 185/week @ 2022-12-21 168/week @ 2022-12-28 55/week @ 2023-01-04 188/week @ 2023-01-11 157/week @ 2023-01-18 207/week @ 2023-01-25

643 downloads per month
Used in 5 crates

MIT license

100KB
2K SLoC

Tokio async/await preview

This crate provides a preview of Tokio with async / await support. It is a shim layer on top of tokio.

This crate requires Rust nightly and does not provide API stability guarantees. You are living on the edge here.

Usage

To use this crate, you need to start with a Rust 2018 edition crate, with rustc 1.35.0-nightly or later.

Add this to your Cargo.toml:

# In the `[packages]` section
edition = "2018"

# In the `[dependencies]` section
tokio = {version = "0.1.15", features = ["async-await-preview"]}

Then, get started. In your application, add:

// The nightly features that are commonly needed with async / await
#![feature(await_macro, async_await, futures_api)]

// This pulls in the `tokio-async-await` crate. While Rust 2018 doesn't require
// `extern crate`, we need to pull in the macros.
#[macro_use]
extern crate tokio;

fn main() {
    // And we are async...
    tokio::run_async(async {
        println!("Hello");
    });
}

Because nightly is required, run the app with cargo +nightly run

Check the examples directory for more.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies

~475KB