Fork me on GitHub

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?


Never mind... I was bungled and botched. simple_smile