summaryrefslogtreecommitdiff
path: root/lib/tapicero_daemon.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tapicero_daemon.rb')
-rw-r--r--lib/tapicero_daemon.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/tapicero_daemon.rb b/lib/tapicero_daemon.rb
new file mode 100644
index 0000000..a5347c7
--- /dev/null
+++ b/lib/tapicero_daemon.rb
@@ -0,0 +1,25 @@
+#
+# 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 " * 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
+ end
+end