diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-03-07 13:55:00 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-03-07 13:55:00 +0000 |
commit | 22912b1f7e82542b66f53be02ea1b8be3402e728 (patch) | |
tree | 56bf0bf58c7726fe5f4dd7e8d0adad0ac69f2e53 /python/qpid/delegates.py | |
parent | 6c5dae81f69c2b5fa8fbc3dee0ac90a6bdbb76fa (diff) | |
download | qpid-python-22912b1f7e82542b66f53be02ea1b8be3402e728.tar.gz |
added timeouts to hello-010-world; switched to conditions rather than events for handling connection/session state; handle session exceptions
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@634678 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/delegates.py')
-rw-r--r-- | python/qpid/delegates.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/python/qpid/delegates.py b/python/qpid/delegates.py index 4fdcc37384..83413b91ea 100644 --- a/python/qpid/delegates.py +++ b/python/qpid/delegates.py @@ -19,6 +19,7 @@ import connection010 import session +from util import notify class Delegate: @@ -49,7 +50,8 @@ class Delegate: self.connection.sock.close() def connection_close_ok(self, ch, close_ok): - self.connection.closed.set() + self.connection.opened = False + notify(self.connection.condition) def session_attach(self, ch, a): try: @@ -61,7 +63,7 @@ class Delegate: ch.session_detached(a.name) def session_attached(self, ch, a): - ch.session.opened.set() + notify(ch.session.condition) def session_detach(self, ch, d): self.connection.detach(d.name, ch) @@ -70,7 +72,7 @@ class Delegate: def session_detached(self, ch, d): ssn = self.connection.detach(d.name, ch) if ssn is not None: - ssn.closed.set() + notify(ch.session.condition) def session_command_point(self, ch, cp): ssn = ch.session @@ -91,8 +93,9 @@ class Server(Delegate): pass def connection_open(self, ch, open): - self.connection.opened.set() + self.connection.opened = True ch.connection_open_ok() + notify(self.connection.condition) class Client(Delegate): @@ -108,4 +111,5 @@ class Client(Delegate): ch.connection_open() def connection_open_ok(self, ch, open_ok): - self.connection.opened.set() + self.connection.opened = True + notify(self.connection.condition) |