From fb6d0df6f047b50cd47f1f242f67fa8cbddb9979 Mon Sep 17 00:00:00 2001 From: "Steve L. Nyemba" Date: Thu, 16 Feb 2017 07:48:36 -0600 Subject: [PATCH] adding flush function to transport, it addresses the problem of data growth --- src/utils/transport.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/utils/transport.py b/src/utils/transport.py index 3c696af..7b9bc11 100644 --- a/src/utils/transport.py +++ b/src/utils/transport.py @@ -105,6 +105,15 @@ class Writer: elif xchar is None and isinstance(row,dict): row = json.dumps(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 The file will be heald in memory and processed accordingly @@ -314,7 +323,11 @@ class QueueWriter(MessageQueue,Writer): ); 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