yage.core.repeater
Authors:
Eric Poggel
License:
LGPL v3
- class
Repeater
: yage.core.timer.Timer, yage.core.object2.IDisposable;
- A class to repeatedly call a function at a set inverval, in its own thread.
TODO:
Can this be combined with setInterval / setTimeout?
- this(bool start = false);
- Initialize the Timer
Params:
bool start |
start the Timer immediately. |
- void
dispose
();
- void
pause
();
- Pause the repeater.
This is guaranteed to never
pause
in the middle of a call to the repeater's function, but will
block until the call finishes.
- synchronized double
getCallTime
();
synchronized void
setCallTime
(double call_time);
- Get / set the call time.
This will always be within tell() and tell()-frequency unless the repeater is behind in calling its function.
Unless the frequency changes, call time can be divided by frequency to get the call count.
Returns:
time in seconds.
- synchronized double
getFrequency
();
synchronized void
setFrequency
(double frequency);
- Get / set the frequency.
The frequency defaults to 60hz until set.
If the call function is set, it will be called this many times per second.
Returns:
time in hertz.
- synchronized void delegate(float f)
getFunction
();
synchronized void
setFunction
(void delegate(float f) func);
synchronized void
setFunction
(void function(float f) func);
- Get / set the function to call.
- synchronized void delegate(Exception e)
getErrorFunction
();
synchronized void
setErrorFunction
(void delegate(Exception e) on_error);
synchronized void
setErrorFunction
(void function(Exception e) on_error);
- Get / set a function to call if the update function throws an exception.
If this is set to null
(the default), then the exception will just be thrown as normal.
|