summaryrefslogtreecommitdiff
path: root/lib/tapicero_daemon.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-09-10 18:57:52 +0200
committerAzul <azul@riseup.net>2013-09-10 18:57:52 +0200
commit7958827a0ba1126646e01314e7c6bb4f86292dc8 (patch)
treed4079d37c38e025486212d6b9f1d327fd1a7651e /lib/tapicero_daemon.rb
parent57140b80f00aab43918a3ec3276062823971dec7 (diff)
use our own JsonStream and a created callback in CouchChanges
Diffstat (limited to 'lib/tapicero_daemon.rb')
-rw-r--r--lib/tapicero_daemon.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/tapicero_daemon.rb b/lib/tapicero_daemon.rb
index a5347c7..5f754c7 100644
--- a/lib/tapicero_daemon.rb
+++ b/lib/tapicero_daemon.rb
@@ -8,18 +8,13 @@
require 'tapicero'
module Tapicero
+ puts " * Observing #{Config.couch_host}"
puts " * Tracking #{Config.users_db_name}"
couch = CouchStream.new(Config.couch_host + Config.users_db_name)
- changes = CouchChanges.new(couch)
-
- # fill the pool
- # pool.fill
-
- # watch for deletions, fill the pool whenever it gets low
- changes.follow do |hash|
- if hash[:created]
- puts " Created #{hash.inspect}"
- # pool.fill
- end
+ users = CouchChanges.new(couch)
+ users.created do |hash|
+ puts "Created user " + hash[:id]
end
+
+ users.listen
end