Просмотр исходного кода

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

Steve L. Nyemba 9 лет назад
Родитель
Сommit
fb6d0df6f0
1 измененных файлов с 14 добавлено и 1 удалено
  1. 14 1
      src/utils/transport.py

+ 14 - 1
src/utils/transport.py

@@ -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