Skip to content

How do I check whether the server is just started #3264

Answered by robjtede
thebluetropics asked this question in Q&A
Discussion options

You must be logged in to vote
// 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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thebluetropics
Comment options

Answer selected by thebluetropics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants