adding flush function to transport, it addresses the problem of data growth

master
Steve L. Nyemba 8 years ago
parent 1ab48fa012
commit fb6d0df6f0

@ -105,6 +105,15 @@ class Writer:
elif xchar is None and isinstance(row,dict): elif xchar is None and isinstance(row,dict):
row = json.dumps(row) row = json.dumps(row)
return row return row
"""
It is important to be able to archive data so as to insure that growth is controlled
Nothing in nature grows indefinitely neither should data being handled.
"""
def archive(self):
pass
def flush(self):
pass
""" """
This class is designed to read data from an Http request file handler provided to us by flask This class is designed to read data from an Http request file handler provided to us by flask
The file will be heald in memory and processed accordingly The file will be heald in memory and processed accordingly
@ -314,7 +323,11 @@ class QueueWriter(MessageQueue,Writer):
); );
self.close() self.close()
def flush(self,label):
self.init(label)
_mode = 1 #-- Non persistent
self.channel.queue_delete( queue=label);
self.close()
""" """
This class will read from a queue provided an exchange, queue and host This class will read from a queue provided an exchange, queue and host

Loading…
Cancel
Save