From bb2883b9f5cfad0e028a9849ed91e36418a2d0ff Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 21 Aug 2007 15:51:41 +0000 Subject: Refresh of transitional xml to more closely reflect latest specification Initial execution-result support (not yet handled on c++ client) Generation is now all done through the ruby code (it is a little slower at present I'm afraid, will try to speed it up over the next weeks) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568174 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/peer.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'python/qpid/peer.py') diff --git a/python/qpid/peer.py b/python/qpid/peer.py index 6762f774f4..6ad5482f09 100644 --- a/python/qpid/peer.py +++ b/python/qpid/peer.py @@ -208,6 +208,8 @@ class Channel: self.responses.close() self.completion.close() self.incoming_completion.reset() + for f in self.futures.values(): + f.put_response(self, reason) def write(self, frame, content = None): if self.closed: @@ -324,7 +326,10 @@ class Channel: raise ValueError(resp) elif frame.method.result: if self.synchronous: - return future.get_response(timeout=10) + fr = future.get_response(timeout=10) + if self.closed: + raise Closed(self.reason) + return fr else: return future elif self.synchronous and not frame.method.response \ @@ -373,7 +378,10 @@ class Future: def get_response(self, timeout=None): self.completed.wait(timeout) - return self.response + if self.completed.isSet(): + return self.response + else: + return None def is_complete(self): return self.completed.isSet() -- cgit v1.2.1