Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chrisdone-artificial/fac9039214ca1f1c6035875ef665f3e1 to your computer and use it in GitHub Desktop.

Select an option

Save chrisdone-artificial/fac9039214ca1f1c6035875ef665f3e1 to your computer and use it in GitHub Desktop.
import System.Posix.Signals
main = do
mainId <- myThreadId
_ <-
installHandler
softwareTermination
(CatchOnce
(do putStrLn "Received SIGTERM. Killing main thread."
killThread mainId))
Nothing
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment