Created
January 20, 2011 11:20
-
-
Save pmoran/787759 to your computer and use it in GitHub Desktop.
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
def run | |
EventMachine.run { | |
opts = { query: {feed: 'continuous', since: update_seq, heartbeat: 5000, filter: 'app/pending', include_docs: true} } | |
http = EventMachine::HttpRequest.new("#{DB_URL}/_changes").get opts | |
http.stream { |chunk| handle_notification(chunk) unless chunk =~ /^\n/ } | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment