add tokio example

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
This commit is contained in:
Pat Hickey
2021-04-13 17:15:31 -07:00
parent 66251c2e78
commit 759019811e
5 changed files with 202 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
[package]
name = "example-tokio-wasm"
version = "0.0.0"
authors = ["The Wasmtime Project Developers"]
edition = "2018"
publish = false
[[bin]]
path = "tokio-wasi.rs"
name = "tokio-wasi"

View File

@@ -0,0 +1,6 @@
fn main() {
let name = std::env::var("NAME").unwrap();
println!("Hello, world! My name is {}", name);
std::thread::sleep(std::time::Duration::from_secs(1));
println!("Goodbye from {}", name);
}