Hello Tom, I think you are talking about distribution, not parallelization. As I see (sorry for not reading enough previously) you want a way to handle different things in a sequential way where each sequence of things (already grouped) are handled in a different thread.
You can put the things in a specific channel (*core.async*) depending on your *:id* (for example), and you can handle each specific channel on their own thread (*future* maybe). I can be wrong but if I understood well you have a fairly plausible solution using *future*s and *core.async*'s channels. Excuse me for not helping you more. I'm in a work meeting. Saludos. El viernes, 16 de junio de 2017, 9:13:11 (UTC-5), Tom Connors escribió: > > I'm looking for a function that would likely be named something like > "sequential-by" or "parallel-per" that takes some data-producing thing like > a lazy seq or a core async channel, a function to split records from that > input, and a function to handle each item. Each item with an identical > return value from the "split" function would be handled sequentially, while > the handling of the collection as a whole would be parallel. > > If we assume this signature: > (parallel-per splitter handler inputs) > > > Calling it like this: > (parallel-per :id > (fn [m] (prn (update m :val inc))) > [{:id 1 :val 1}, {:id 1 :val 2}, {:id 3 :val 1}]) > > > Would result in the first two maps being handled sequentially, while the > third map is handled in parallel with the first two. The order of the > printed lines would probably be non-deterministic, except {:id 1 :val 2} > would be printed before {:id 1 :val 3}. > > Note that for my use case I don't care about return values, but if > something like this already exists it's plausible that it returns something > equivalent to (map handler inputs). > > Does anything like this already exist in core or some lib? If not, any > recommendations for how to build it? > -- 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.