From 862282ce99760832d3e9e5b4b1171b861105e004 Mon Sep 17 00:00:00 2001 From: Ebus-at-dockstar Date: Mon, 25 Mar 2013 10:24:28 +0100 Subject: move old stuff away --- heap/datastore/store/processor.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 heap/datastore/store/processor.py (limited to 'heap/datastore/store/processor.py') 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) + -- cgit v1.2.1