[Twisted-Python] Re: Making DeferredList look like Deferred
Lenny G Arbage
alengarbage at yahoo.com
Mon Feb 6 13:05:01 EST 2006
Thomas HERVE therve at free.fr wrote:
> The behaviour you want is provided by the
> option 'consumeErrors' of DeferredList
> (you can see why here :
Aha, that's the piece I was missing! Thank you for
pointing it out.
Now, though, this leads me to one more question:
what if I want to wait until all the Deferreds have
fired (either err or callback), and only then call the
callback if all callbacks were fired, otherwise call
To accomplish this, I'm currently just 'wrapping'
the DeferredList in a regular Deferred. It's callback
is always called on completion, so when it fires I
look at all the results given to the callback, and if
any have failed, raise an exception. Otherwise I
return a result.
This feels a little bit clunky, but I don't have a
good suggestion for improving it --
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Twisted-Python