terminal-wait-exit

Crates.ioterminal-wait-exit
lib.rsterminal-wait-exit
version1.0.0
sourcesrc
created_at2024-06-13 10:46:49.855908
updated_at2024-06-13 10:46:49.855908
descriptionwait user exit terminal, like Ctrl+C
homepage
repositoryhttps://github.com/chen3cn/terminal-wait-exit
max_upload_size
id1270536
size2,918
(chen3)

documentation

README

terminal-wait-exit

wait user exit terminal, like Ctrl+C.

Usage

#[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();
}
Commit count: 0

cargo fmt