Skip to content

Instantly share code, notes, and snippets.

Created July 20, 2013 02:46
What would you like to do?
Clojure core.async example 1
(ns async1
(:require [clojure.core.async :as async]))
(defn alice [c]
(async/>!! c "Carol Carolson's House @ 10pm"))
(defn bob [c]
(async/go (println "Bob received: " (async/<! c))))
(let [phonenumber-555-555-9292 (async/chan)]
; Bob waits for Alice's text
(bob phonenumber-555-555-9292)
; Alice sends Bob the text
(alice phonenumber-555-555-9292))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment