summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2011-02-11 13:34:44 +0000
committerMarko Kreen2011-02-11 13:54:22 +0000
commitea9d3a5525b67718d74d3a5d3a12acfef687521a (patch)
tree7845b80b242bfc3e9ac6132a6e2ee884823aaa82
parentde83f8095d7eb100f21778b61922b6e71be4741a (diff)
londiste: new qtable handler
-rw-r--r--python/londiste/handlers/__init__.py5
-rw-r--r--python/londiste/handlers/qtable.py22
2 files changed, 26 insertions, 1 deletions
diff --git a/python/londiste/handlers/__init__.py b/python/londiste/handlers/__init__.py
index c5de83c6..8dd6b7fc 100644
--- a/python/londiste/handlers/__init__.py
+++ b/python/londiste/handlers/__init__.py
@@ -1,4 +1,7 @@
# handlers module
-DEFAULT_HANDLERS = ['londiste.handlers.bulk']
+DEFAULT_HANDLERS = [
+ 'londiste.handlers.bulk',
+ 'londiste.handlers.qtable',
+]
diff --git a/python/londiste/handlers/qtable.py b/python/londiste/handlers/qtable.py
new file mode 100644
index 00000000..f32bb1eb
--- /dev/null
+++ b/python/londiste/handlers/qtable.py
@@ -0,0 +1,22 @@
+"""
+Dummy handler to setup queue tables. All events are ignored.
+"""
+
+from londiste.handler import BaseHandler
+
+__all__ = ['QueueTableHandler']
+
+class QueueTableHandler(BaseHandler):
+ """Queue table handler. Do nothing"""
+ handler_name = 'qtable'
+
+ def add(self, trigger_arg_list):
+ """Create SKIP and BEFORE INSERT trigger"""
+ trigger_arg_list.append('tgflags=BI')
+ trigger_arg_list.append('SKIP')
+
+ def process_event(self, ev, sql_queue_func, arg):
+ """Ignore events for this table"""
+
+__londiste_handlers__ = [QueueTableHandler]
+