Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have copied the code below from the following link - https://gist.github.com/martintrojer/5943467
- (defn async-get [url result]
- (org.httpkit.client/get url #(go (>! result %))))
- (time
- (def hk-data
- (let [c (chan)
- res (atom [])]
- ;; fetch em all
- (doseq [i (range 10 100)]
- (async-get (format "http://fssnip.net/%d" i) c))
- ;; gather results
- (doseq [_ (range 10 100)]
- (swap! res conj (<!! c)))
- @res
- )))
Advertisement
Add Comment
Please, Sign In to add comment