[][src]Macro simple_on_shutdown::on_shutdown

macro_rules! on_shutdown {
    ($cb:block) => { ... };
    ($cb:expr) => { ... };
}

Convenient constructor macro for ShutdownCallbackDummy. Pass in an expression or a block of code you want to be executed during shutdown.

IMPORTANT: Use this on the top level of your main() or whatever your current runtimes main function is! The code gets executed when the context it lives in gets dropped. This can be called multiple times (at least with stable Rust 1.48.0) without problem.

This crate uses the log crate on the debug level.