Module Scheduler
Models time events calling event handing functions.
SCHEDULER class
The SCHEDULER class models time events calling given event handling functions.
SCHEDULER constructor
The SCHEDULER class is quite easy to use:
- SCHEDULER.New: Setup a new scheduler and start it with the specified parameters.
SCHEDULER timer methods
The SCHEDULER can be stopped and restarted with the following methods:
- SCHEDULER.Start: (Re-)Start the scheduler.
- SCHEDULER.Start: Stop the scheduler.
Global(s)
| SCHEDULER |
Type SCHEDULER
| SCHEDULER.ClassName | |
| SCHEDULER:New(TimeEventObject, TimeEventFunction, TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds) |
Constructor. |
| SCHEDULER.Repeat | |
| SCHEDULER:Start() |
(Re-)Starts the scheduler. |
| SCHEDULER:Stop() |
Stops the scheduler. |
| SCHEDULER:_Scheduler() |
Global(s)
Type Scheduler
Type SCHEDULER
The SCHEDULER class
Field(s)
- #string SCHEDULER.ClassName
- SCHEDULER:New(TimeEventObject, TimeEventFunction, TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds)
-
Constructor.
Parameters
-
#table TimeEventObject: Specified for which Moose object the timer is setup. If a value of nil is provided, a scheduler will be setup without an object reference. -
#function TimeEventFunction: The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in TimeEventFunctionArguments. -
#table TimeEventFunctionArguments: Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }. -
#number StartSeconds: Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called. -
#number RepeatSecondsInterval: Specifies the interval in seconds when the scheduler will call the event function. -
#number RandomizationFactor: Specifies a randomization factor between 0 and 1 to randomize the RepeatSecondsInterval. -
#number StopSeconds: Specifies the amount of seconds when the scheduler will be stopped.
Return value
#SCHEDULER: self
-
- #boolean SCHEDULER.Repeat
- SCHEDULER:Start()
-
(Re-)Starts the scheduler.
Return value
#SCHEDULER: self
- SCHEDULER:Stop()
-
Stops the scheduler.
Return value
#SCHEDULER: self