summaryrefslogtreecommitdiff
path: root/test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test.rb')
-rw-r--r--test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test.rb b/test.rb
new file mode 100644
index 0000000..7b4d50e
--- /dev/null
+++ b/test.rb
@@ -0,0 +1,23 @@
+#!/usr/bin/ruby
+
+require 'rubygems'
+require "yajl/http_stream"
+
+Signal.trap('INT') { AMQP.stop{ EM.stop } }
+Signal.trap('TERM'){ AMQP.stop{ EM.stop } }
+
+def main
+ url = "http://localhost:5984/"
+ db = "test"
+ feed_type = "continuous"
+ since = "0"
+ queue = "changes"
+
+ Yajl::HttpStream.get("#{url}#{db}/_changes?feed=#{feed_type}&since=#{since}", :symbolize_keys => true) do |hash|
+ if hash[:id]
+ #p hash
+ end
+ end
+end
+
+main