Skip to content

Instantly share code, notes, and snippets.

@whilo
Last active August 29, 2015 13:57
Show Gist options
  • Save whilo/9418732 to your computer and use it in GitHub Desktop.
Save whilo/9418732 to your computer and use it in GitHub Desktop.
Debugging core.async channels.
(def chan-log (atom []))
(defn debug-chan [pre]
(let [c (chan)
lc (chan)]
(async/tap (async/mult c) lc)
(go-loop [m (<! lc)]
(swap! chan-log conj [pre m])
(recur (<! lc)))
c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment