Crates.io | terminal-wait-exit |
lib.rs | terminal-wait-exit |
version | 1.0.0 |
source | src |
created_at | 2024-06-13 10:46:49.855908 |
updated_at | 2024-06-13 10:46:49.855908 |
description | wait user exit terminal, like Ctrl+C |
homepage | |
repository | https://github.com/chen3cn/terminal-wait-exit |
max_upload_size | |
id | 1270536 |
size | 2,918 |
wait user exit terminal, like Ctrl+C.
#[tokio::main]
async fn main() {
// Spawn the server into a runtime
tokio::spawn(async move {
// work
server.serve(service).await;
});
if let Err(e) = wait_exit::wait_exit().await {
error!("Listening exit failed.{:?}", e);
}
stop_graceful();
}