[pygtk] gobject.timeout_add timeout recalculation
mitko at qlogic.com
Fri May 16 04:58:08 WST 2008
In my application, I am using gobject.timeout_add to trigger periodic
updates of the status of a number of machines.
However, I am having a bit of trouble understanding exactly how the
timeout is calculated. According to the documentation:
After each call to the timeout function, the time of the next
timeout is recalculated based on the current time and the
given interval (it does not try to 'catch up' time lost in delays).
The "After each call to the timeout function,..." leads me to think
that the timer is reset when the timeout function returns. However, the
phrase "(it does not try to 'catch up' time lost in delays)." makes me
think that the timer is reset as soon as the timeout function thread is
started. (This also seems to be confirmed by tracing my code)
What I would like to happen is that the timeout gets recalculated when
my timeout function is done/returns. I guess, I could add a new timeout
from within my timeout function and have it [the timeout function]
return False (so the old timeout is destroyed) but I am thinking that
there has to be a better way to do this.
I appreciate any advice on the matter.
A Fortran compiler is the hobgoblin of little minis.
More information about the pygtk