Module: tasks

tasks

API for managing recurrent tasks.

Source:

Methods

<static> build(handler, interval, id) → {Object}

Schedules a recurrent task.

Parameters:
Name Type Description
handler function

Required. This function is invoked when the task scheduling condtions are met.

interval number

Optional. Number of milliseconds in between recurrences of the handler being invoked.

id String

Optional. Unique identifier for the task.

Source:
Returns:

a task object wrapping the provided parameters (handler, interval, id).

Type
Object

<static> schedule(task, scheduler) → {Promise}

Parameters:
Name Type Description
task Object

Required. Wrapper object for task characteristics.

Properties
Name Type Description
handler function

Required. This function is invoked when the task scheduling conditions are met.

interval number

Optional. Number of milliseconds in between recurrences of the handler being invoked.

id String

Optional. Unique identifier for the task.

scheduler Object

Required. A scheduler strategy, similar to @see memoryScheduler.

Source:
Returns:

Promise Promise .resolve and .reject handlers will be called depending on the success or failure of the handler function when it is invoked.

Type
Promise