diff options
Diffstat (limited to 'lib/tapicero_daemon.rb')
-rw-r--r-- | lib/tapicero_daemon.rb | 17 |
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 |