From 7ab0d62a8eb3ae2024dad4399103c227dcc108dd Mon Sep 17 00:00:00 2001 From: "Steve L. Nyemba" Date: Sat, 7 Jan 2017 09:27:20 -0600 Subject: [PATCH] commenting changes in transport, allowing queue reader to read from n-queues --- src/utils/transport.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/transport.py b/src/utils/transport.py index a3f42ff..b794d53 100644 --- a/src/utils/transport.py +++ b/src/utils/transport.py @@ -362,6 +362,9 @@ class QueueReader(MessageQueue,Reader): self.data[qid] = [] self.data[qid].append(r) + # + # We stop reading when the all the messages of the queue are staked + # if self.size == len(self.data[qid]) or len(self.data[qid]) == self.info.method.message_count: self.close() @@ -374,6 +377,10 @@ class QueueReader(MessageQueue,Reader): def read(self,size=-1): r = {} self.size = size + # + # We enabled the reader to be able to read from several queues (sequentially for now) + # The qid parameter will be an array of queues the reader will be reading from + # for qid in self.qid: self.init(qid) # r[qid] = [] @@ -387,7 +394,7 @@ class QueueReader(MessageQueue,Reader): #self.close() # r[qid].append( self.data) - print self.data + return self.data """