Created
May 6, 2018 08:56
-
-
Save malcolmsparks/0b70e4027c595eb6cd0b8a44357cd09b to your computer and use it in GitHub Desktop.
Reset on HUP signal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn reset-on-hup [] | |
(let [bindings (get-thread-bindings)] | |
(sun.misc.Signal/handle | |
(sun.misc.Signal. "HUP") | |
(reify sun.misc.SignalHandler | |
(handle [_ signal] | |
(with-bindings bindings | |
(println (reset)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment