Created
November 23, 2018 02:40
-
-
Save enocom/e136a60ee30eb1d81ad2ee7964628d54 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
(ns scratch.core | |
(:require [clojure.core.async :as a])) | |
(defn start-runner [] | |
(let [stop (a/chan)] | |
(a/go-loop [] | |
(when (a/alt! stop false :default :keep-going) | |
(do (Thread/sleep 1000) | |
(println "Running...")) | |
(recur))) | |
stop)) | |
(comment | |
(def stop (start-runner)) | |
(a/close! stop) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment