Skip to content

Instantly share code, notes, and snippets.

@neotyk
Created May 10, 2012 10:06
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 neotyk/2652261 to your computer and use it in GitHub Desktop.
Save neotyk/2652261 to your computer and use it in GitHub Desktop.
counting parts and collecting body
(let [counter (atom 0)]
(http-r/execute-request
c (http-r/prepare-request :get "http://www.nu.nl/")
:part (fn [resp part]
(swap! counter inc)
(println @counter)
(http-r/body-collect resp part))
:completed (fn [resp]
(println (count (http/string resp)))
(println :parts @counter))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment