Skip to content

Instantly share code, notes, and snippets.

@pmoran
Created January 20, 2011 11:20
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 pmoran/787759 to your computer and use it in GitHub Desktop.
Save pmoran/787759 to your computer and use it in GitHub Desktop.
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