summaryrefslogtreecommitdiff
path: root/python/examples/reservations/common.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-02-17 17:58:23 +0000
committerRafael H. Schloming <rhs@apache.org>2010-02-17 17:58:23 +0000
commit6169654064ad15136946f278d5c486143256bed1 (patch)
tree1ab31f36d20159cedc06a63d3c03fa8f34cbb5ee /python/examples/reservations/common.py
parent3b5c8116495040153703d0849c45d9d521f96b79 (diff)
downloadqpid-python-6169654064ad15136946f278d5c486143256bed1.tar.gz
removed sender caching as this should now be unnecessary
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@911121 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples/reservations/common.py')
-rw-r--r--python/examples/reservations/common.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/python/examples/reservations/common.py b/python/examples/reservations/common.py
index 4f9efd0227..24e64beda4 100644
--- a/python/examples/reservations/common.py
+++ b/python/examples/reservations/common.py
@@ -46,7 +46,6 @@ class Dispatcher:
return ()
def run(self, session):
- senders = {}
while self.running():
msg = session.next_receiver().fetch()
replies = self.dispatch(msg)
@@ -54,22 +53,17 @@ class Dispatcher:
count = len(replies)
sequence = 1
for r in replies:
- if senders.has_key(r.to):
- rsnd = senders[r.to]
- else:
- rsnd = session.sender(r.to)
- senders[r.to] = rsnd
-
r.correlation_id = msg.correlation_id
r.properties["count"] = count
r.properties["sequence"] = sequence
sequence += 1
try:
- rsnd.send(r)
+ snd = session.sender(r.to)
+ snd.send(r)
except SendError, e:
print e
- del senders[r.to]
- rsnd.close()
+ finally:
+ snd.close()
session.acknowledge(msg)