Fork me on GitHub

@joshjones excellent suggestion. Thanks


I'm at a slight loss. I want to do, effectively, the following:

(let [raw-records-ch (get-records)]
   (async/into [] (take 10) raw-records-ch))
In other words, take up to 10 values from raw-records-ch and collect them in a vector, and convey the single vector as the result. However, async/into doesn't support an xform. I can jury-rig something using async/pipe, but it's ugly. Is there a trick I'm missing?


(async/transduce (take 10) conj [] (get-records))
is the best I've come up with.

Alex Miller (Clojure team)21:05:01

That seems to say exactly what you want to do

Alex Miller (Clojure team)21:05:04

An enhancement to add xf to async/into seems reasonable too btw


I'd used transducers but not transduce (core or async) before, so it took a bit of experimentation to work it out.


But a simple core.async patch to add an into arity pretty much like above would be good. Maybe this friday.