[Twisted-Python] reactor.callLater question
glyph at twistedmatrix.com
Tue Nov 15 13:27:39 EST 2011
On Nov 15, 2011, at 9:57 AM, exarkun at twistedmatrix.com wrote:
> On 02:33 pm, tobias.oberstein at tavendo.de wrote:
>> 2 short questions .. please consider:
>> reactor.callLater(0, fun1)
>> reactor.callLater(0, fun2)
>> Is that allowed .. delay == 0? It seems to work .. but I want to be
> Yep. It's allowed. It means to run the function pretty soon, but not
> right now.
>> reactor.callLater(T, fun1)
>> reactor.callLater(T, fun2)
>> Is the call _order_ first fun1, then fun2 _guaranteed_?
>> For every T, and in particular T == 0?
> This isn't guaranteed. It's been proposed that it should be, but the
> ticket has been languishing for a few years now:
You might want to look at twisted.internet.task.cooperate instead if you want to perform a sequence of functions separated by callLater()s.
More information about the Twisted-Python