Maybe it's not exactly what you need, but i did similar thing once - i 
needed to scrape many linked html resources to extract tree data structure, 
each request/parse operation took considerable time - around 2 seconds - i 
was using clj-http/enlive combo (which is actualy Apache HttpClient/ 
TagSoup under the hood). Therefore i needed to parallelize this operations 
as much as possible and clojure pmap function provides exactly that (with 
futures and threads under the hood). Many times i stumbled upon people 
complaining that use of the pmap actually sloves down rather then speeds 
the code, but this is because the coordination overhead for managing 
threads is substantional, so it's probably not useful for tasks where the 
actual mapping function runs very fast, but in my case, the speedup in 
comparison to normal map function was massive - here is the 
code<https://github.com/janherich/lazada-quest/blob/master/src/lazada_quest/scrapper.clj>i'm
 talking about.

Dňa utorok, 31. decembra 2013 9:46:53 UTC+1 chinmoy debnath napísal(-a):
>
> I am a newbie in clojure. I need to send multiple http requests in 
> parallel and need to have a call back when response for each request come 
> back. What will be the idiomatic way of doing it in clojure?
> Thanks in advacne
>
>

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