MonkeyBars Class
Item Index
Methods
- createBlobWithTask
- createPropertyDescriptorsWithAttributes
- createSubTasksFromTaskOptionsArray
- createTaskWithOptions
- createWebWorkerWithBlobAndTask
- decorateTaskBasedOnAttributes
- extend
- forTaskDecorator
- generateUniqueId
- isTaskDependentOnTask
- log
- performTaskFunctionalityWithWebWorker
- serialize
- whenTaskDecorator
- whileTaskDecorator
Properties
Methods
createBlobWithTask
-
task
Creates a blob string to be used with the web worker for concurrent task execution
Parameters:
-
taskTask
Returns:
createPropertyDescriptorsWithAttributes
-
attributes
Creates property descriptors from the passes attributes.
Parameters:
-
attributesObject
Returns:
createSubTasksFromTaskOptionsArray
-
tasks
Creates an array of tasks based on the options array passed.
Parameters:
-
tasksArray
Returns:
createTaskWithOptions
-
options
Creates task based on the options passed.
Parameters:
-
optionsObject
Returns:
createWebWorkerWithBlobAndTask
-
blob -
task
Creates a web Worker instance with the passed arguments
Parameters:
-
blobBlob -
taskTask
Returns:
extend
-
protoProps
Extention functionality for various task types.
Parameters:
-
protoPropsObject
Returns:
Example:
var CustomTask = MonkeyBars.Task.extend({
name:"CustomTask",
newMethod:function(){
console.log("Executing newMethod");
}
});
var instance = new CustomTask();
forTaskDecorator
-
task
Decorator to provide for loop functionality for the task. The task executes as many times as referenced by the count attribute provided by the instance.
Parameters:
-
taskObject
generateUniqueId
-
prefix
Generates a unique id for each task.
Parameters:
-
prefixString
Returns:
isTaskDependentOnTask
-
task1 -
task2
Determains whether the first task is dependent on the second.
Returns:
log
-
msg
Simple console.log wrapper
Parameters:
-
msgObject
performTaskFunctionalityWithWebWorker
-
task
Performs the tasks performTask functionality within a web worker
Parameters:
-
taskTask
serialize
-
o
Variation of http://blog.stchur.com/2007/04/06/serializing-objects-in-javascript/
Parameters:
-
oObject
Returns:
whenTaskDecorator
-
task
The task doesnt execute until the when method provided returns true.
Parameters:
-
taskObject
whileTaskDecorator
-
task
Decorator to provide while loop functionaliy. The task executed until the while
method returns false.
Parameters:
-
taskObject
Properties
LogLevels
Object
final
Log level contstants.
MonkeyBars
Object
Object returned by module. Works as namespace for the task library.
root
Object
private
Reference to the global js object (i.e. brower's window)
taskIdCounter
Integer
private
Counter used to create unique task ids
taskOptions
Array
private
List of all whitelisted properties for a task
TaskStates
Object
final
Task states contstants.
TaskTypes
Object
final
Task types contstants.
