On 02/07/13 20:05, Brian Kirkbride wrote:

One thing that I really like about blocking in acquire vs submitting everything to an ExecutorService/CompletionService right off the bat: you can bail out of the remainder of the computation when one part fails. I've got a function that creates a lazy Seq that will become empty if any application of (f x) fails. That means you don't even schedule the remaining items. You can, of course, check and abort inside of (f x) too. But there's a lot to like about not processing those items at all. Especially in composed pipelines of functions.

aaa ok now we're getting slightly off just 'mapping'. I thought all you wanted to do was a parallel map - I didn't realise there is more logic to it (aborting and stuff).... now it makes sense why you won't like something like this either which can use hundreds of threads no problem :)

(->> coll
  (map agent)
  (map #(send-off % f)))

Jim

--
--
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/groups/opt_out.


Reply via email to