Merge lp:~therve/txamqp/close-queues into lp:txamqp

Proposed by Thomas Herve
Status: Merged
Approved by: Esteve Fernandez
Approved revision: 13
Merged at revision: not available
Proposed branch: lp:~therve/txamqp/close-queues
Merge into: lp:txamqp
Diff against target: None lines
To merge this branch: bzr merge lp:~therve/txamqp/close-queues
Reviewer Review Type Date Requested Status
Esteve Fernandez Approve
Review via email: mp+6017@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Esteve Fernandez (esteve) wrote :

Thanks Thomas!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/txamqp/protocol.py'
2--- src/txamqp/protocol.py 2009-02-05 19:22:56 +0000
3+++ src/txamqp/protocol.py 2009-04-21 10:18:10 +0000
4@@ -255,6 +255,8 @@
5 def close(self, reason):
6 for ch in self.channels.values():
7 ch.close(reason)
8+ for q in self.queues.values():
9+ q.close()
10 self.delegate.close(reason)
11
12 def writer(self, frame):
13
14=== modified file 'src/txamqp/test/test_queue.py'
15--- src/txamqp/test/test_queue.py 2008-10-29 18:31:04 +0000
16+++ src/txamqp/test/test_queue.py 2009-04-21 10:18:10 +0000
17@@ -257,3 +257,15 @@
18 self.assertChannelException(404, e.args[0])
19
20
21+ @inlineCallbacks
22+ def test_close_queue(self):
23+ from txamqp.queue import Closed as QueueClosed
24+ channel = self.channel
25+
26+ reply = yield channel.queue_declare(queue="test-queue")
27+ reply = yield channel.basic_consume(queue="test-queue")
28+
29+ queue = yield self.client.queue(reply.consumer_tag)
30+ d = self.assertFailure(queue.get(timeout=1), QueueClosed)
31+ self.client.close(None)
32+ yield d

Subscribers

People subscribed via source and target branches

to status/vote changes: