I have a simple worker that performs command line commands when it receives tasks. I want to implement a SIGINT handler that continues the current task, and stops directly after. I now have the handler in place using the
ctrlc crate, but when I press CTRL+C, the command that is executed is also directly receiving a SIGINT, causing the console command to be effectively killed before finishing successfully.
Command::new(&executable) .args(&arguments) .output();
How can I prevent that the command line commands that I execute with
std::process::Command are not affected by the SIGINT which I catch in my main loop?