API for managing recurrent tasks.
- Source:
Methods
-
<static> build(handler, interval, id) → {Object}
-
Schedules a recurrent task.
Parameters:
Name Type Description handlerfunction Required. This function is invoked when the task scheduling condtions are met.
intervalnumber Optional. Number of milliseconds in between recurrences of the handler being invoked.
idString 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 taskObject Required. Wrapper object for task characteristics.
Properties
Name Type Description handlerfunction Required. This function is invoked when the task scheduling conditions are met.
intervalnumber Optional. Number of milliseconds in between recurrences of the handler being invoked.
idString Optional. Unique identifier for the task.
schedulerObject 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