zng_env

Function on_process_exit

source
pub fn on_process_exit(handler: impl FnOnce(&ProcessExitArgs) + Send + 'static)
Expand description

Register a handler to run once when the current process exits.

Note that the handler is only called if the process is terminated by exit, or by the executable main function returning if init! is called on it.