How do I check whether the server is just started #3264
Answered
by
robjtede
thebluetropics
asked this question in
Q&A
Replies: 1 comment 2 replies
-
// server is not up yet
let task_handle = tokio::spawn(server.run());
// server is now started and listening
println!("server is listening...")
let _ = task_handle.await;
// server has now shutdown |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
thebluetropics
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Node.js + Express, I can do this:
How can I achieve the same result as this?
Should I put it in the
Ok(server) => {}
?Or is there any other appropriate way to do this?
Beta Was this translation helpful? Give feedback.
All reactions