From 454379917ad7b797a045cbefc56bf598e3fd534b Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Sat, 14 Nov 2009 16:08:05 +0000 Subject: added support for sender/receiver delete, made tests clean up after themselves, split logging of raw bytes and unencoded ops into distinct categories git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@836200 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/messaging.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'python/qpid/messaging.py') diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py index ec1c054e14..703a958425 100644 --- a/python/qpid/messaging.py +++ b/python/qpid/messaging.py @@ -436,14 +436,15 @@ class Session: """ Close the session. """ + # XXX: should be able to express this condition through API calls + self._ewait(lambda: not self.outgoing and not self.acked) + for link in self.receivers + self.senders: link.close() self.closing = True self._wakeup() self._ewait(lambda: self.closed) - # XXX: should be able to express this condition through API calls - self._ewait(lambda: not self.outgoing and not self.acked) self.connection._remove_session(self) class SendError(SessionError): @@ -557,10 +558,12 @@ class Sender: """ Close the Sender. """ - # XXX: should make driver do something here - if not self.closed: + self.closing = True + self._wakeup() + try: + self.session._ewait(lambda: self.closed) + finally: self.session.senders.remove(self) - self.closed = True class ReceiveError(SessionError): pass -- cgit v1.2.1