diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-05-09 19:26:28 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-05-09 19:26:28 +0000 |
commit | 603062f5008305e67446ef5b98c51cb2168e54d0 (patch) | |
tree | 4d7bfeb24ae5ae01fa5555da17b90c7e9e82f3ef /python/qpid/session.py | |
parent | b0f3edfa2a68ccf34aa7a555d0d37c2e17b8421b (diff) | |
download | qpid-python-603062f5008305e67446ef5b98c51cb2168e54d0.tar.gz |
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
Diffstat (limited to 'python/qpid/session.py')
-rw-r--r-- | python/qpid/session.py | 13 |
1 files changed, 12 insertions, 1 deletions
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): |