Make asynchronous via tokio
Change-Id: I0dd405d46807797882af6585a939b0d0fc362d06
Reviewed-on: https://git.clicks.codes/c/Clicks/BYO/HttpServer/rust/+/256
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/src/main.rs b/src/main.rs
index eb6b198..bdd2cf6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,7 +40,7 @@
line_num += 1;
}
- println!("{:?}", request);
+ // println!("{:?}", request);
let mut path = request.get("path").unwrap().split("/");
@@ -88,6 +88,6 @@
loop {
let (socket, _) = listener.accept().await?;
- futures.push(process_socket(socket));
+ futures.push(tokio::spawn(process_socket(socket)));
}
}