Created
January 28, 2016 22:22
-
-
Save noisesmith/e6a3e0ae424e129ece19 to your computer and use it in GitHub Desktop.
handling signals in clojure
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
kingfisher.core=> (def hndlr (reify sun.misc.SignalHandler (handle [this signal](println "handling some sig!")))) | |
#'kingfisher.core/hndlr | |
kingfisher.core=> (sun.misc.Signal/handle (sun.misc.Signal. "USR2") hndlr) | |
#object[kingfisher.core$reify__32853 0x6bc27f36 "kingfisher.core$reify__32853@6bc27f36"] | |
kingfisher.core=> (clojure.java.shell/sh "kill" "-s" "SIGUSR2" "72011") | |
handling some sig! | |
{:exit 0, :out "", :err ""} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment