package
0.0.0-20240628090047-e7e75416fc67
Repository: https://github.com/sethiyash/golang.git
Documentation: pkg.go.dev
# README
Graceful SIGINT killing
Given is a mock process which runs indefinitely and blocks the program. Right now the only way to stop the program is to send a SIGINT (Ctrl-C). Killing a process like that is not graceful, so we want to try to gracefully stop the process first.
Change the program to do the following:
- On SIGINT try to gracefully stop the process using
proc.Stop()
- If SIGINT is called again, just kill the program (last resort)