Skip to content

Instantly share code, notes, and snippets.

@antoniogarrote
Created November 1, 2010 08:33
Show Gist options
  • Save antoniogarrote/657828 to your computer and use it in GitHub Desktop.
Save antoniogarrote/657828 to your computer and use it in GitHub Desktop.
(time
(let [*pdfs-proms* (map (fn [[pdf id]] [pdf id (promise)]) *pdfs*)]
(doseq [[pdf id prom] *pdfs-proms*]
(future
(do
(spit (str id ".pdf") (slurp (java.net.URL. pdf)))
(deliver prom :ok))))
(doseq [[_ _ prom] *pdfs-proms*]
(deref prom))))
;; Elapsed time: 346.363 msecs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment