Created
March 8, 2010 16:41
-
-
Save ashafa/325335 to your computer and use it in GitHub Desktop.
This file contains 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
(defn wait-for-changes | |
[& _] | |
(let [update-seq (:update_seq (database-info "test-changes"))] | |
(with-open [is (with-db "test-changes" | |
(couchdb-request (assoc config :read-json-response false) | |
:get (str "_changes?feed=continuous&heartbeat=5000&since=" update-seq)))] | |
(loop [lines (io/read-lines is)] | |
(if-let [line (first lines)] | |
line | |
(recur lines)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment