Skip to content

Instantly share code, notes, and snippets.

@pmoran
Created Jan 20, 2011
Embed
What would you like to do?
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