Skip to content

Instantly share code, notes, and snippets.

Last active December 20, 2015 01:18
What would you like to do?
Clojure core.async example 3
(ns async3
(:require [clojure.core.async :as async]))
(defn alice [c message]
(async/>!! c message))
(defn person [name c]
(let [message (async/<! c)]
(println name " received: " message)
(def bob (partial person "Bob"))
(def carol (partial person "Carol"))
(def dave (partial person "Dave"))
(let [c (async/chan 1)]
(-> (bob c)
; Alice sends the message
(alice c "Eve Evenson's House @ 10pm"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment