1

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.

Damgot
  • 388
  • 4
  • 17

1 Answers1

1

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

Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122
  • I figured out that sched (an example here http://stackoverflow.com/questions/474528/what-is-the-best-way-to-repeatedly-execute-a-function-every-x-seconds-in-python) has the same problem. So, does the solution is to simply use time.sleep() ? – Damgot May 21 '15 at 05:39