On Tue, Feb 18, 2014 at 4:21 PM, Dustin J. Mitchell <[email protected]>wrote:

> D is returning a Deferred, but you're not doing anything with it.  In
> fact, all of A..E are returning Deferreds and you're ignoring them.
> In an inlineCallbacks-decorated method, you need to yield every
> Deferred you receive.
>

I realize you know this, but just to be clear  for Axel: you only need to
yield deferreds you want to wait on. It's perfectly possible that you don't
yield a deferred but your code is still correct. E.g. let's say that you
want to wait on three ops but you do want them to execute in parallel, then

d1 = f()
d2 = g()
d3 = h()
yield gatherResults(d1, d2, d3)

is totally a thing :-)

yield in @inlineCallbacks just means "pause execution and resume when this
deferred fires".

hth
lvh
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to