Fork me on GitHub
#core-async
<
2017-11-19
>
tomjack18:11:00

(ns dev-kill
  (:require [clojure.core.async :refer [chan]]))

(defonce ^:dynamic *dev-kill* (chan))

(ns foo
  (:require [clojure.core.async :refer :all]
            [dev-kill :refer [*dev-kill*]]))

(defn blah []
  (go-loop [blah]
    (alt! blah (do blah (recur blah))
          *dev-kill* nil)))
?

tomjack18:11:46

(like, I just want you all to stop without killing the dev JVM, but this is not something I want in production)

noisesmith19:11:04

my preferred approach is to start go-loops from system components, and close their input channels as part of the shutdown method

tomjack23:11:53

did not think of component, thanks