[Twisted-Python] DeferredList and errback
Glyph Lefkowitz
glyph at twistedmatrix.com
Sat Jul 13 21:18:38 EDT 2002
On Sun, 14 Jul 2002 02:55:49 +1000, Andrew Bennetts <andrew-twisted at puzzling.org> wrote:
> DeferredList takes care of this nicely, so long as it works.
Rather than adding a whole new class to defer.py, maybe you could make the
other deferred's errback get called by the first one?
> I realise I'm probably too late to get this into 0.19.0, but I'm wondering
> what the right way to provide this is:
> - new class in defer.py (what would it be called?),
"DeferOneOrMany", maybe? Tough thing to name. This is probably the right
approach, though; consider that there are cases where one error might be all
you need, or one success. In those cases you don't want to get a list as your
callback, you just want to get the one value.
> - change the behaviour of DeferredList to do what I want, or
Definitely not!! There are plenty of cases where you need _all_ the operations
to complete regardless of their status of completion.
> - add a flag to the current DeferredList so it can do either behaviour?
As I said above, the behavior is really different; the types of the signatures
for your callbacks will be different. That says "different class" to me.
--
| <`'> | Glyph Lefkowitz: Traveling Sorcerer |
| < _/ > | Lead Developer, the Twisted project |
| < ___/ > | http://www.twistedmatrix.com |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020713/001de197/attachment.pgp
More information about the Twisted-Python
mailing list