[Twisted-Python] Accurate delays in callLater

James Y Knight foom at fuhm.net
Thu Jun 23 15:35:49 MDT 2005


On Jun 23, 2005, at 4:36 PM, Norm Petterson wrote:
> In my case, for instance, 86400 repeated 1 second TimerService  
> calls might take a few minutes more than precisely 24 hours (which  
> is acceptable, so I haven't checked further). I am guessing that  
> something outside of Twisted, running at a higher process priority   
> occasionally ties up the machine long enough to miss at least one  
> scheduled cycle, possibly even more than one. AFAICT LoopingCall  
> doesn't make any attempt to compensate for entirely missed (i.e.,  
> catastrophically missed) cycles, only for the minor slippage that  
> might otherwise lead to gradually missed ones. Right?

Right. It may be a desirable to add a subclass which will pass the  
number of cycles the function should run as the first argument. For  
many purposes (e.g. animation), it's acceptable to skip cycles, as  
long as you know how many you skipped and catch up the animation that  
far when you do end up getting scheduled.

James




More information about the Twisted-Python mailing list