Module Scheduler

This module contains the SCHEDULER class.

1) Scheduler#SCHEDULER class, extends Base#BASE

The Scheduler#SCHEDULER class models time events calling given event handling functions.

1.1) SCHEDULER constructor

The SCHEDULER class is quite easy to use:

1.2) SCHEDULER timer stop and start

The SCHEDULER can be stopped and restarted with the following methods:

Global(s)

SCHEDULER

Type SCHEDULER

SCHEDULER.ClassName
SCHEDULER:New(TimeEventObject, TimeEventFunction, TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds)

SCHEDULER constructor.

SCHEDULER.Repeat
SCHEDULER.ScheduleID

the ID of the scheduler.

SCHEDULER:Start()

(Re-)Starts the scheduler.

SCHEDULER:Stop()

Stops the scheduler.

SCHEDULER:_Scheduler()

Global(s)

#SCHEDULER SCHEDULER

Type Scheduler

Type SCHEDULER

The SCHEDULER class

Field(s)

#string SCHEDULER.ClassName
SCHEDULER:New(TimeEventObject, TimeEventFunction, TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds)

SCHEDULER 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
#number SCHEDULER.ScheduleID

the ID of the scheduler.

SCHEDULER:Start()

(Re-)Starts the scheduler.

Return value

#SCHEDULER: self

SCHEDULER:Stop()

Stops the scheduler.

Return value

#SCHEDULER: self

SCHEDULER:_Scheduler()