[Twisted-Python] Questions about twisted.python.delay.Delayed

Matt Campbell mattcampbell at pobox.com
Sun Sep 30 14:20:56 EDT 2001


I'm a relatively new user of Twisted (started using it in late August
to write a custom server), and I have a few questions about the
twisted.python.delay.Delayed class.

1.  Why does Delayed measure time in units of five-second ticks by

2.  Why is Delayed.run() called every five seconds or so even when there
are no delayed tasks scheduled?  Wouldn't the process's CPU usage be
slightly lower if Delayed.timeout() returned None when the queue is empty?

3.  What is the recommended way to specify, for example, that a function
should be called approximately 30 seconds from now?  Should I pass 6 as
the number of ticks to Delayed.later(), or is there a better way to do it?

Thank you.
Matt Campbell <http://www.pobox.com/~mattcampbell/>

More information about the Twisted-Python mailing list