Task
Classes
Members
- id_counter :
number
Task
Kind: global class
- Task
- new Task([name], [initializer], cycleFunction, [computeProgress], [dependencies], [estimatedDuration])
- instance
- .id :
number
- .state :
ObservedInteger
- .__executedCpuTime :
number
- .__executedCycleCount :
number
- .dependencies :
Array.<Task>
- .estimatedDuration :
number
- .name :
string
- .cycle :
function
- .initialize :
function
- .isTask :
boolean
- .getExecutedCpuTime() ⇒
number
- .addDependency(task) ⇒
- .addDependencies(tasks)
- .join(resolve, reject)
- .executeSync()
- .promise() ⇒
Promise
- .id :
- static
new Task([name], [initializer], cycleFunction, [computeProgress], [dependencies], [estimatedDuration])
Param | Type | Default | Description |
---|---|---|---|
[name] | string | useful for identifying the task later on, for various UI and debug purposes | |
[initializer] | function | function to be executed just before task starts | |
cycleFunction | function | ||
[computeProgress] | function | ||
[dependencies] | Array.<Task> | [] | |
[estimatedDuration] | number | 1 | in seconds |
task.id : number
Kind: instance property of Task
Read only: true
task.state : ObservedInteger
Kind: instance property of Task
task.__executedCpuTime : number
amount of time spent running this task in milliseconds
Kind: instance property of Task
Access: public
task.__executedCycleCount : number
number of time task's cycle function was executed
Kind: instance property of Task
Access: public
task.dependencies : Array.<Task>
Kind: instance property of Task
task.estimatedDuration : number
Kind: instance property of Task
task.name : string
Kind: instance property of Task
task.cycle : function
Kind: instance property of Task
task.initialize : function
Kind: instance property of Task
task.isTask : boolean
Kind: instance property of Task
Read only: true
task.getExecutedCpuTime() ⇒ number
Time in milliseconds that the task has been executing for, suspended time does not count
Kind: instance method of Task
task.addDependency(task) ⇒
Kind: instance method of Task
Returns: Task
Param | Type |
---|---|
task | Task | TaskGroup |
task.addDependencies(tasks)
Kind: instance method of Task
Param | Type |
---|---|
tasks | Array.<(Task|TaskGroup)> |
task.join(resolve, reject)
Kind: instance method of Task
Param | Type |
---|---|
resolve | function |
reject | function |
task.executeSync()
Run entire task synchronously to completion
Kind: instance method of Task
task.promise() ⇒ Promise
Kind: instance method of Task
Task.promiseAll(tasks) ⇒ Promise
Kind: static method of Task
Param | Type |
---|---|
tasks | Array.<(Task|TaskGroup)> |
Task.promise(task)
Kind: static method of Task
Param | Type |
---|---|
task | Task | TaskGroup |
Task.join(task, resolve, reject)
Kind: static method of Task
Param | Type |
---|---|
task | Task |
resolve | function |
reject | function |
Task.joinAll(tasks, resolve, reject)
Kind: static method of Task
Param | Type |
---|---|
tasks | Array.<Task> |
resolve | function |
reject | function |
id_counter : number
Kind: global variable