Skip to content

Instantly share code, notes, and snippets.

@seancron
Created July 28, 2010 18:36
Show Gist options
  • Save seancron/495738 to your computer and use it in GitHub Desktop.
Save seancron/495738 to your computer and use it in GitHub Desktop.
(def dns-cache (new Cache))
(defn lookup-dns
"Does a DNS lookup with no cache"
[host]
(let [dnsLookup (new Lookup host)]
(. dns-cache clearCache)
(. dnsLookup setCache dns-cache)
(. dnsLookup run)
(. dnsLookup getResult)))
<snip>
(let [agents (for [host hosts] (agent host))]
(doseq [agent agents]
(send-off agent lookup-dns))
(apply await agents)
(doseq [agent agents]
(println @agent)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment