summaryrefslogtreecommitdiff
path: root/lib/tapicero_daemon.rb
blob: 5f754c79e8007a6a93ef683204edaec51abe53d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#
# This file should not be required directly. Use the wrapper in /bin
# instead or run this using daemons:
#
#  Daemons.run('tapicero_daemon.rb')
#

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)
  users = CouchChanges.new(couch)
  users.created do |hash|
    puts "Created user " + hash[:id]
  end

  users.listen
end