new Task(coordinator, name, interval, offset, timeout, fn)
lib/Task.js, line 13
Represent a task. You don't instantiate this class directly, instead you should use Coordinator#schedule
Name | Type | Description |
---|---|---|
coordinator |
Coordinator | |
name |
string | |
interval |
number | |
offset |
number | |
timeout |
number | |
fn |
Coordinator~runTask |
Members
-
coordinatorCoordinator
-
-
-
intervalnumber
-
-
namestring
-
-
offsetnumber
-
-
runningboolean
-
-
timeoutnumber
-
Methods
-
getNext(){Date}
lib/Task.js, line 52 -
Return the next datetime this task will try to run. This will not start, stop nor change the current task schedule in any way
Returns:
Type Description Date -
start(){Date}
lib/Task.js, line 70 -
Schedule next execution for this task and return the execution date
Returns:
Type Description Date -
stop()
lib/Task.js, line 62 -
Stop scheduling this task. Note that this will not stop a currently running operation