Module: 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

Run-time type information.

Type:
  • boolean
Source:

Methods

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

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.

Source:
Throws:

If inputs are invalid.

Type
Error
Returns:

A new generic component.

Type
Object

__ca_getInterval__() → {number}

Gets time in miliseconds between task invocations.

Source:
Returns:

Time in miliseconds between task invocations.

Type
number

__ca_start__(fun)

Starts the cron.

Parameters:
Name Type Description
fun function

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

Source:

__ca_stop__()

Stops executing periodic tasks.

Shutting down a cron always stops it.

Source: