Skip to content

Commit 765f81f

Browse files
Tokio Runtime
Run function for starting async thread
1 parent 299151a commit 765f81f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

server/src/main.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
use tokio::runtime::Runtime;
2+
13
fn main() {
2-
println!("Hello, world!");
4+
5+
let rt = Runtime::new().expect("Runtime error { tokio failed to create async runtime... }");
6+
7+
rt.block_on( async {
8+
run().await;
9+
});
10+
}
11+
12+
async fn run(){
13+
314
}

0 commit comments

Comments
 (0)