Skip to main content

setup_signal_handler

Function setup_signal_handler 

Source
pub fn setup_signal_handler<F>(cleanup_fn: F) -> impl Fn()
where F: Fn() + Send + Sync + 'static,
Expand description

Setup CTRL+C handler for graceful shutdown

§Arguments

  • cleanup_fn - Function to call on CTRL+C

§Returns

Function to remove the handler