From 603062f5008305e67446ef5b98c51cb2168e54d0 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Fri, 9 May 2008 19:26:28 +0000 Subject: QPID-1045 and QPID-1041: added a destination attribute to incoming queues, and added a start() method to incoming queues as syntactic sugar for the verbose message flow idiom git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@654918 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/session.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'python/qpid/session.py') diff --git a/python/qpid/session.py b/python/qpid/session.py index a1103e0428..aa0446b941 100644 --- a/python/qpid/session.py +++ b/python/qpid/session.py @@ -75,7 +75,7 @@ class Session(Invoker): try: queue = self._incoming.get(destination) if queue == None: - queue = Queue() + queue = Incoming(self, destination) self._incoming[destination] = queue return queue finally: @@ -319,6 +319,17 @@ class Sender: for range in commands.ranges: self._completed.add(range.lower, range.upper) +class Incoming(Queue): + + def __init__(self, session, destination): + Queue.__init__(self) + self.session = session + self.destination = destination + + def start(self): + for unit in self.session.credit_unit.values(): + self.session.message_flow(self.destination, unit, 0xFFFFFFFF) + class Delegate: def __init__(self, session): -- cgit v1.2.1