Skip to content

Instantly share code, notes, and snippets.

@dakrone

dakrone/foo.clj Secret

Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakrone/01c46b660465356bf0d2 to your computer and use it in GitHub Desktop.
Save dakrone/01c46b660465356bf0d2 to your computer and use it in GitHub Desktop.
(ns clj-http.foo
(:require [clj-http.client :as client]))
(def url-list-from-symbols ["http://www.aoeu.com" "http://www.aoeu.com/bad"])
(defn async-gets [urls]
(doall (map #(future (client/get % {:throw-exceptions false}))
urls)))
(let [gets (async-gets (take 10 url-list-from-symbols))
fail? (fn [req-fut] (not (client/success? @req-fut)))]
(map fail? gets))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment