core.async provides its own implementation of merge that returns a ManyToMany channel. So that's why the call to merge is returning a channel. But why I haven't a clue. I still claim that you have a dirty repl or something.
Timothy On Wed, May 7, 2014 at 6:11 AM, Valentin Luchko <akme...@gmail.com> wrote: > Sorry, but you guys didn't understand the problem. > *tbc++*, I don't use core.async, so I don't require it > dgrnbrg, I don't want to interface these libraries together. > Let me try explain again. > > 1. I have http-kit socket server running > 2. When client connects I store its connection (http-kit's AsyncChannel) > in map @clients as a key, line 19 (swap! clients assoc con true) > 3. Then when some data received from client line 21-22 > > (on-receive con (fn [data] > (handler))) > I invoke handler > > (defn handler [] > (future (let > [merged (merge {} @clients)] > (println merged)) ; => #<ManyToManyChannel > clojure.core.async.impl.channels.ManyToManyChannel@5d9c832a>, but expect to > get copy of @clients > #_(let > [into-map (into {} @clients)] ; here I get exception > <IllegalArgumentException java.lang.IllegalArgumentException: No > implementation of method: :take! of protocol: > #'clojure.core.async.impl.protocols/ReadPort found for class: nil > (println into-map)))) > > Here I want just to make the copy of @clients with simple merge to empty map, > but I don't get a copied map, I get #<ManyToManyChannel > clojure.core.async.impl.channels.ManyToManyChannel@5d9c832a> > > When trying use into I get I get exception. > > I just want to know what is going on, why I get ManyToManyChannel instead of > @clients map copy? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.