Hi All,
I was recently looking at how to make better use of parallelisation for simple tasks in my compojure app, I had a construction similar to the following:
(views/some-view (api/api-call-1) (api/api-call-2) (api/api-call-3))
It seemed that the easiest way to introduce some parallelism here would be in the style of a let form:
(let [result-1 (api/api-call-1)
result-2 (api/api-call-2)
result-3 (api/api-call-3)]
(views/some-view result-1 result-2 result-3)
There doesn't appear to be anything in core that does, this - after a brief discussion in the IRC channel, I received the following two suggestions: https://gist.github.com/jcromartie/5459350 and https://gist.github.com/guv/5459364
I ended up going with the approach from "guv", as I understood it better - and I moved the let form inside the view function to cut down on the repetition a bit.
Now, to my actual questions:
What are the differences between the pmap approach and the futures approach?
And would a construction like this be useful in core? If so, how does it potentially get there?
Thanks
Glen Mailer
Budding Clojurer
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.