Skip to content

Instantly share code, notes, and snippets.

@enocom
Created November 23, 2018 02:40
Show Gist options
  • Save enocom/e136a60ee30eb1d81ad2ee7964628d54 to your computer and use it in GitHub Desktop.
Save enocom/e136a60ee30eb1d81ad2ee7964628d54 to your computer and use it in GitHub Desktop.
(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