Demonstrating async fn and inline async block
https://jbarszczewski.com/basics-of-asynchronous-rust-with-tokio
--- /dev/null
+[package]
+name = "tokio-tutorial-jbarszczewski"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+tokio = {version = "1.21", features = ["full"]}
--- /dev/null
+use tokio::join;
+
+async fn guten_tag() {
+ println!("Guten Tag!");
+}
+
+#[tokio::main]
+async fn main() {
+ let task1 = tokio::spawn(async {
+ println!("Hello, world!");
+ });
+ let task2 = tokio::spawn(guten_tag());
+
+ let (r1, r2) = join!(task1, task2);
+ r1.unwrap();
+ r2.unwrap()
+}