Created
May 10, 2012 10:06
-
-
Save neotyk/2652261 to your computer and use it in GitHub Desktop.
counting parts and collecting body
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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