Skip to content

Instantly share code, notes, and snippets.

@chrisdone
Created June 21, 2022 11:35
Show Gist options
  • Save chrisdone/6baa39093104028b2876019ca33c3731 to your computer and use it in GitHub Desktop.
Save chrisdone/6baa39093104028b2876019ca33c3731 to your computer and use it in GitHub Desktop.
import System.Posix.Signals
main = do
mainId <- RIO.myThreadId
_ <-
installHandler
softwareTermination
(CatchOnce
(do S8.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