Created
August 7, 2014 18:14
-
-
Save jlongster/585019272cde6d14d8e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns csp.core | |
(:require [clojure.core.async :as async | |
:refer [chan go >! <! <!! timeout pub sub]]) | |
(:require [clojure.pprint :refer [pprint]]) | |
(:gen-class)) | |
(def c1 (chan)) | |
(def c2 (chan)) | |
(defn -main [& args] | |
(go | |
(let [merged (merge [c1 c2])] | |
(println (<! merged)))) | |
(println "starting") | |
(go | |
(>! c1 :foo) | |
(>! c2 :bar)) | |
(<!! (go (<! (timeout 10000))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error: