Defer problem

Jean-Paul Calderone exarkun at divmod.com
Wed Jan 7 14:05:53 CET 2009


On Wed, 7 Jan 2009 04:44:43 -0800 (PST), wladimir <wladimirufc at gmail.com> wrote:
>
>Hi,
>
>I have an problem. I want to fire one callback after n callbacks fired, but
>when i fire one callback all the chain will be executed. Example:
>
>def handle(x):
>    print 'callback ' + str(x)
>
>
>def handle2(x):
>    print 'after callbacks'
>
>
>d1 = defer.Deffered()
>d2 = defer.Deffered()
>d3 = defer.Deffered()
>
>d = defer.DeferredList([d1, d2, d3], fireOnOneCallback =1 ,
>fireOnOneErrback=1)

`fireOnOneCallback´ is the flag which makes the `DeferredList´ fire when
the first wrapped `Deferred´ has fired.  If you want the `DeferredList´
to only fire after all of the wrapped deferreds have fired, don't pass
this flag.

Jean-Paul



More information about the Python-list mailing list