Merge lp:~therve/txamqp/worker-gc into lp:txamqp

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

This looks good and logical to me. I guess it's deliberate that you don't use yield in the new code, because you want to be sure the errback is added before you yield control? (I'm not so good at twisted, and trying to learn more).

Revision history for this message
Esteve Fernandez (esteve) :
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-05-04 11:12:36 +0000
3+++ src/txamqp/protocol.py 2009-06-01 16:35:03 +0000
4@@ -266,14 +266,12 @@
5 self.sendFrame(frame)
6 self.outgoing.get().addCallback(self.writer)
7
8- @defer.inlineCallbacks
9 def worker(self, queue):
10- try:
11- yield self.dispatch(queue)
12- queue = yield self.work.get()
13- self.worker(queue)
14- except Exception, e:
15- self.close(e)
16+ d = self.dispatch(queue)
17+ def cb(ign):
18+ self.work.get().addCallback(self.worker)
19+ d.addCallback(cb)
20+ d.addErrback(self.close)
21
22 @defer.inlineCallbacks
23 def dispatch(self, queue):

Subscribers

People subscribed via source and target branches

to status/vote changes: