twisted.internet.defer.DeferredList(Deferred) class documentationtwisted.internet.defer
(View In Hierarchy)
DeferredList
is a tool for collecting the results of several Deferreds.
This tracks a list of Deferreds for 
their results, and makes a single callback when they have all completed.  
By default, the ultimate result is a list of (success, result) tuples, 
'success' being a boolean. DeferredList
exposes the same API that Deferred does,
so callbacks and errbacks can be added to it in the same way.
DeferredList
is implemented by adding callbacks and errbacks to each Deferred in 
the list passed to it.  This means callbacks and errbacks added to the 
Deferreds before they are passed to DeferredList
will change the result that DeferredList
sees (i.e., DeferredList
is not special). Callbacks and errbacks can also be added to the Deferreds 
after they are passed to DeferredList
and DeferredList
may change the result that they see.
See the documentation for the __init__ arguments for more 
information.
| Method | __init__ | Initialize a DeferredList. | 
| Method | cancel | Cancel this DeferredList. | 
| Instance Variable | _deferredList | The listofDeferreds to 
track. | 
| Method | _cbDeferred | (internal) Callback for when one of my deferreds fires. | 
Inherited from Deferred:
| Instance Variable | called | A flag which is Falseuntil eithercallbackorerrbackis called and afterwards alwaysTrue. (type:bool) | 
| Instance Variable | paused | A counter of how many unmatched pausecalls have been made on 
this instance. (type:int) | 
| Method | addCallbacks | Add a pair of callbacks (success and error) to this Deferred. | 
| Method | addCallback | Convenience method for adding just a callback. | 
| Method | addErrback | Convenience method for adding just an errback. | 
| Method | addBoth | Convenience method for adding a single callable as both a callback and an errback. | 
| Method | addTimeout | Time out this Deferredby 
scheduling it to be cancelled aftertimeoutseconds. | 
| Method | chainDeferred | Chain another Deferredto 
thisDeferred. | 
| Method | callback | Run all success callbacks that have been added to this Deferred. | 
| Method | errback | Run all error callbacks that have been added to this Deferred. | 
| Method | pause | Stop processing on a Deferreduntilunpause()
is called. | 
| Method | unpause | Process all callbacks made since pause() 
was called. | 
| Method | __str__ | Return a string representation of this Deferred. | 
| Method | __iter__ | Undocumented | 
| Method | send | Undocumented | 
| Method | asFuture | Adapt a Deferredinto 
aasyncio.Futurewhich is bound toloop. | 
| Class Method | fromFuture | Adapt an asyncio.Futureto aDeferred. | 
| Instance Variable | _suppressAlreadyCalled | A flag used by the cancellation mechanism which is Trueif the
Deferred has no canceller and has been cancelled,Falseotherwise.  IfTrue, it can be expected thatcallbackorerrbackwill eventually be called and
the result should be silently discarded. (type:bool) | 
| Instance Variable | _runningCallbacks | A flag which is Truewhile this instance is executing its 
callback chain, used to stop recursive execution of_runCallbacks(type:bool) | 
| Instance Variable | _chainedTo | If this Deferredis 
waiting for the result of anotherDeferred, this
is a reference to the other Deferred.  Otherwise,None. | 
| Method | _startRunCallbacks | Undocumented | 
| Method | _continuation | Build a tuple of callback and errback with _CONTINUE. | 
| Method | _runCallbacks | Run the chain of callbacks once a result is available. | 
Initialize a DeferredList.
| Parameters | deferredList | The list of deferreds to track. (type: listofDeferreds) | 
| fireOnOneCallback | (keyword param) a flag indicating that this DeferredListwill fire when the firstDeferredindeferredListfires with a non-failure result without waiting 
for any of the other Deferreds.  When this flag is set, the DeferredList 
will fire with a two-tuple: the first element is the result of the Deferred
which fired; the second element is the index indeferredListof that Deferred. (type:bool) | |
| fireOnOneErrback | (keyword param) a flag indicating that this DeferredListwill fire when the firstDeferredindeferredListfires with a failure result without waiting for 
any of the other Deferreds.  When this flag is set, if a Deferred in the 
list errbacks, the DeferredList will errback with aFirstErrorfailure wrapping the failure of that Deferred. (type:bool) | |
| consumeErrors | (keyword param) a flag indicating that failures in any of the included Deferreds 
should not be propagated to errbacks added to the individualDeferreds 
after thisDeferredListis constructed.  After constructing theDeferredList,
any errors in the individualDeferreds will
be converted to a callback result ofNone.
This is useful to prevent spurious 'Unhandled error in Deferred' messages 
from being logged.  This does not preventfireOnOneErrbackfrom working. (type:bool) | 
(internal) Callback for when one of my deferreds fires.
Cancel this DeferredList.
If the DeferredList
hasn't fired yet, cancel every Deferred in 
the list.
If the DeferredList
has fired, including the case where the 
fireOnOneCallback/fireOnOneErrback flag is set 
and the DeferredList
fires because one Deferred in 
the list fires with a non-failure/failure result, do nothing in the 
cancel method.