caf_components/gen_cron

Generic cron component.

A cron is an active object that performs the same task every interval miliseconds.

Source:

Extends

Members

__ca_isCron__ :boolean

Source:

Run-time type information.

Type:
  • boolean

Methods

(static) create($, spec) → {Object}

Source:

Helper constructor method for a cron component.

Description of types in file types.js.

Parameters:
Name Type Description
$ ctxType

A context containing references to other components.

spec specType

Configuration data for this component.

Throws:

If inputs are invalid.

Type
Error
Returns:

A new generic component.

Type
Object

__ca_getInterval__() → {number}

Source:

Gets time in miliseconds between task invocations.

Returns:

Time in miliseconds between task invocations.

Type
number

__ca_start__(fun)

Source:

Starts the cron.

Parameters:
Name Type Description
fun function

A task to be performed repeatedly. Its type is function():void.

__ca_stop__()

Source:

Stops executing periodic tasks.

Shutting down a cron always stops it.