summaryrefslogtreecommitdiff
path: root/lib/tapicero_daemon.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-09-10 09:44:38 +0200
committerAzul <azul@riseup.net>2013-09-10 09:44:38 +0200
commit57140b80f00aab43918a3ec3276062823971dec7 (patch)
tree759de1356d0cee24e44a4229629ddaf2fc662ad0 /lib/tapicero_daemon.rb
parentc221405796270f46d8d4881183fd55fd4d977da9 (diff)
bringing over couch_changes from leap_ca including tests
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