Created
July 14, 2011 19:12
-
-
Save asimjalis/1083188 to your computer and use it in GitHub Desktop.
How to call clojure.contrib.shell-out/sh with timeout
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
(use '[clojure.contrib.shell-out :only [sh]]) | |
(defn sh-timeout [timeout-in-seconds & args] | |
(.get | |
(future-call #(apply sh args)) | |
timeout-in-seconds | |
(java.util.concurrent.TimeUnit/SECONDS))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment