Search code examples
pythontwistedreactor

Python Twister Reactor callLater time source?


I figured out that when I schedule a function with :

reactor.callLater(delay, function)

If during the delay, the system date is changed, the delay set in reactor.callLater will not be respected.

So, for example, if at 15:00:00 I schedule my function in 30 secondes :

reactor.callLater(30, function)

If during these 30 secondes, the system date is set to 14:00:00, my function will be called at 15:00:30 and not at 14:00:30 (so 1 hour and 30 seconds delay instead of 30 seconds).

So is there a way to tell to reactor to not use the system date but to work like a time.sleep() ?

Thanks for your help.


Solution

  • Not quite. This is a long-standing but yet unimplemented feature request. See https://twistedmatrix.com/trac/ticket/2424.