This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-14
Channels
- # beginners (74)
- # boot (23)
- # braid-chat (7)
- # cider (5)
- # clara (3)
- # cljsjs (17)
- # cljsrn (1)
- # clojure (105)
- # clojure-austin (9)
- # clojure-new-zealand (34)
- # clojure-poland (2)
- # clojure-russia (177)
- # clojure-uk (41)
- # clojure-ukraine (2)
- # clojurescript (130)
- # component (1)
- # core-async (2)
- # core-matrix (6)
- # cursive (7)
- # data-science (103)
- # datomic (24)
- # emacs (15)
- # funcool (4)
- # hoplon (21)
- # immutant (151)
- # ldnclj (76)
- # melbourne (1)
- # off-topic (8)
- # om (152)
- # om-next (1)
- # onyx (26)
- # parinfer (38)
- # re-frame (13)
- # reagent (14)
- # spacemacs (1)
- # vim (92)
- # yada (1)
Hello. I'm having problems with an async channel stored in an atom. IE, it is always coming up nil. I'm creating two channels with this function: (defn add-client [uid-kw] (if (nil? (get @clients uid-kw)) (let [to-chan (chan) from-chan (chan)] (swap! clients assoc-in [uid-kw :to] to-chan) (swap! clients assoc-in [uid-kw :from] from-chan) (from-loop uid-kw from-chan) (to-loop uid-kw to-chan)))) Later, I am testing the cannel with this: (defn from-loop [uid-kw from-chan] (go-loop [] (let [incoming (<! (get-in @clients [uid-kw :from]))] (comment (debugf "\nreceiving from %s: %s" uid-kw incoming)) (client-event incoming) (recur)))) I get an error every time: Exception in thread "async-dispatch-41" java.lang.IllegalArgumentException: No implementation of method: :take! of protocol: #'clojure.core.async.impl.protocols/ReadPort found for class: nil Is the channel going out of scope?