Skip to content

Instantly share code, notes, and snippets.

@jaydonnell
Created December 10, 2010 18:37
Show Gist options
  • Save jaydonnell/736583 to your computer and use it in GitHub Desktop.
Save jaydonnell/736583 to your computer and use it in GitHub Desktop.
(defn send-url [url]
(try
(let [ip (ru/ip-address (get-domain url))]
(log/debug (str "SENDING URL: " url))
(if (@fetchers ip)
(send-off (@fetchers ip)
handle-url
url)
(do
(add-fetcher ip)
(send-off (@fetchers ip)
handle-url
url))))
(catch Exception e (log/debug (str "error sending url: " url) e))))
(def consumer (agent 0 :error-handler (fn [a e]
(log/debug (str "consumer error: " e) e))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment