Skip to main content

Task

Classes

Task

Members

id_counter : number

Task

Kind: global class

new Task([name], [initializer], cycleFunction, [computeProgress], [dependencies], [estimatedDuration])

ParamTypeDefaultDescription
[name]stringuseful for identifying the task later on, for various UI and debug purposes
[initializer]functionfunction to be executed just before task starts
cycleFunctionfunction
[computeProgress]function
[dependencies]Array.<Task>[]
[estimatedDuration]number1in 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

ParamType
taskTask | TaskGroup

task.addDependencies(tasks)

Kind: instance method of Task

ParamType
tasksArray.<(Task|TaskGroup)>

task.join(resolve, reject)

Kind: instance method of Task

ParamType
resolvefunction
rejectfunction

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

ParamType
tasksArray.<(Task|TaskGroup)>

Task.promise(task)

Kind: static method of Task

ParamType
taskTask | TaskGroup

Task.join(task, resolve, reject)

Kind: static method of Task

ParamType
taskTask
resolvefunction
rejectfunction

Task.joinAll(tasks, resolve, reject)

Kind: static method of Task

ParamType
tasksArray.<Task>
resolvefunction
rejectfunction

id_counter : number

Kind: global variable