From 22912b1f7e82542b66f53be02ea1b8be3402e728 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Fri, 7 Mar 2008 13:55:00 +0000 Subject: 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 --- python/qpid/queue.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/qpid/queue.py') diff --git a/python/qpid/queue.py b/python/qpid/queue.py index 00946a9156..ea8f00d091 100644 --- a/python/qpid/queue.py +++ b/python/qpid/queue.py @@ -35,10 +35,12 @@ class Queue(BaseQueue): def __init__(self, *args, **kwargs): BaseQueue.__init__(self, *args, **kwargs) + self.error = None self.listener = None self.thread = None - def close(self): + def close(self, error = None): + self.error = error self.put(Queue.END) def get(self, block = True, timeout = None): @@ -47,7 +49,7 @@ class Queue(BaseQueue): # this guarantees that any other waiting threads or any future # calls to get will also result in a Closed exception self.put(Queue.END) - raise Closed() + raise Closed(self.error) else: return result -- cgit v1.2.1