I was looking for a pure Clojure solution to run multiple non-
dependant tasks on multiple threads, iv considered using Agent,
Promises or Futures, yet the simplest cleanest succinct solution iv
found is:

(defn email-approved [approved]
  (doall (pmap deref (for [req approved] (future (email-request
req))))))

The only thing that I don't like about it is the use of pmap, main
since Im using the parallel mapping action just for side effects
(triggering the consumptions of futures by derefing them).

Iv seen solution that involve Java service executor and the Work
project (https://github.com/getwoven/work), yet id rather achieve this
in pure Clojure.

Thanks
Ronen

-- 
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

Reply via email to