Skip to content

Instantly share code, notes, and snippets.

@jlongster
Created August 7, 2014 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlongster/585019272cde6d14d8e5 to your computer and use it in GitHub Desktop.
Save jlongster/585019272cde6d14d8e5 to your computer and use it in GitHub Desktop.
(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)))))
@jlongster
Copy link
Author

Error:

jlong-16106:~/projects/csp% lein run
starting
#<IllegalArgumentException java.lang.IllegalArgumentException: No impleme
ntation of method: :take! of protocol: #'clojure.core.async.impl.protocol
s/ReadPort found for class: clojure.lang.PersistentVector>              
%                                                                      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment