Class Index | File Index

Classes


Class scheduler


Extends component.
scheduler
Defined in: scheduler.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
A component that allows for automatic running of logic at certain intervals.
Field Summary
Field Attributes Field Name and Description
 
Returns all registered tasks by name.
Fields borrowed from class component:
host, info, isDrawing, isStepping, onAttach, onDraw, onStep, tag
Method Summary
Method Attributes Method Name and Description
 
endTask(name)
Halts the task with the given name.
 
Returns the millisecond rate of the given task name.
 
Pauses the timer from the pause state.
 
Resumes the scheduler from the pause state.
 
startTask(name, interval, function)
Begins a new task.
Methods borrowed from class component:
canHandleEvent, draw, emitEvent, getKnownEvents, installEvent, installHandler, installHook, step, uninstallEvent, uninstallHandler, uninstallHook
Class Detail
scheduler()
A component that allows for automatic running of logic at certain intervals.
Field Detail
{names} tasks
Returns all registered tasks by name.
Method Detail
endTask(name)
Halts the task with the given name. If there is no task with the given name, no action is taken.
Parameters:
{String} name
Name of the interval to end.

{Number} getTaskInterval(name)
Returns the millisecond rate of the given task name.
Parameters:
{String} name
Returns:
{Number}

pause()
Pauses the timer from the pause state.

resume()
Resumes the scheduler from the pause state.

startTask(name, interval, function)
Begins a new task. A task will run once per every announced millisecond interval. The resolution is only as good as the number of times the host's step() is called. In an Engine context, this is usually locked to the sandboxe's max FPS.
Parameters:
{String} name
Name of the task.
{Number} interval
Interval in milliseconds.
{Function} function
Function to run at the given interval

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Feb 03 2019 18:30:57 GMT-0500 (EST)