Fork me on GitHub
#core-async
<
2016-06-19
>
tap03:06:15

Is there a function to pull all messages from channel to collection? I usually do this by using go-loop to manually pull the messages out. Wonder if there’s an easier way

tap03:06:25

(Invert of onto-chan)

ghadi03:06:49

rather clojure.core.async/into. returns a channel that gives you the collection when complete

tap03:06:13

@ghadi: Thanks. It would be nicer if I don’t have to wrap this with (go (<! )) in clojurescript environment

hiredman03:06:13

in a clojurescript environment you have to, the js runtime is single threaded, so you have to treat it like cooperative scheduling, if you don't yield control, go blocks writing to channels and such don't get a chance to run

tap03:06:42

Ok. I think I got it. Thanks