Created
October 29, 2009 19:19
-
-
Save duncanmak/221718 to your computer and use it in GitHub Desktop.
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
(let [workers (ref [])] | |
(defn monitor-and-pyramid [src dest steps] | |
(if (empty? @workers) | |
(let [monitor (monitor-directory src dest) | |
pyramid (make-image-pyramid dest steps)] | |
(dosync (doseq [w [monitor pyramid]] (.execute w)) | |
(ref-set workers [monitor pyramid]))) | |
(dosync (doseq [w @workers] (.cancel w true)) | |
(println "Cancelled") | |
(ref-set workers []))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment