summaryrefslogtreecommitdiff
path: root/heap/datastore/store/processor.py
diff options
context:
space:
mode:
authorEbus-at-dockstar <ebus@dockstar>2013-03-25 10:24:28 +0100
committerEbus-at-dockstar <ebus@dockstar>2013-03-25 10:24:43 +0100
commit862282ce99760832d3e9e5b4b1171b861105e004 (patch)
tree0e229418e391917b79d42a8bdee46fb7a8612895 /heap/datastore/store/processor.py
parent9522cdffa94f278eb5e1894600535986e22c2890 (diff)
downloadebus-alt-862282ce99760832d3e9e5b4b1171b861105e004.tar.gz
ebus-alt-862282ce99760832d3e9e5b4b1171b861105e004.zip
move old stuff away
Diffstat (limited to 'heap/datastore/store/processor.py')
-rw-r--r--heap/datastore/store/processor.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/heap/datastore/store/processor.py b/heap/datastore/store/processor.py
new file mode 100644
index 0000000..9d39d9a
--- /dev/null
+++ b/heap/datastore/store/processor.py
@@ -0,0 +1,16 @@
+class IProcessor:
+ def __init__(self): raise NotImplementedError()
+ def process(self, name, timestamp, data, controller): pass
+
+class CountingProcessor(IProcessor):
+ def __init__(self, destination):
+ self.destination = destination
+
+ def process(self,name,timestamp,data,controller):
+ current = controller.get(self.destination,None)
+ if not current:
+ current = 0
+ current = int(current)
+
+ controller.put(self.destination, timestamp, current + 1)
+