API Docs for: 0.9.14
Show:

MonkeyBars Class

Methods

createBlobWithTask

(
  • task
)
Blob private

Creates a blob string to be used with the web worker for concurrent task execution

Parameters:

Returns:

Blob: Blob instance

createPropertyDescriptorsWithAttributes

(
  • attributes
)
Object private

Creates property descriptors from the passes attributes.

Parameters:

  • attributes Object

Returns:

Object: Property descriptors object

createSubTasksFromTaskOptionsArray

(
  • tasks
)
Array private

Creates an array of tasks based on the options array passed.

Parameters:

  • tasks Array

Returns:

Array: Array of tasks

createTaskWithOptions

(
  • options
)
Task private

Creates task based on the options passed.

Parameters:

  • options Object

Returns:

Task: Task

createWebWorkerWithBlobAndTask

(
  • blob
  • task
)
Worker private

Creates a web Worker instance with the passed arguments

Parameters:

  • blob Blob
  • task Task

Returns:

Worker: WebWorker instance

decorateTaskBasedOnAttributes

(
  • task
  • attributes
)
private

Parameters:

  • task Task
  • attributes Object

extend

(
  • protoProps
)
Function private

Extention functionality for various task types.

Parameters:

  • protoProps Object

Returns:

Function: child Constructor function for extended task type

Example:

var CustomTask = MonkeyBars.Task.extend({
    name:"CustomTask",
    newMethod:function(){
        console.log("Executing newMethod");
    }
});
var instance = new CustomTask();

forTaskDecorator

(
  • task
)
private

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:

  • task Object

generateUniqueId

(
  • prefix
)
String private

Generates a unique id for each task.

Parameters:

  • prefix String

Returns:

String: tid

isTaskDependentOnTask

(
  • task1
  • task2
)
Boolean private

Determains whether the first task is dependent on the second.

Parameters:

Returns:

Boolean: Whether or not the task is dependent on the other

log

(
  • msg
)
private

Simple console.log wrapper

Parameters:

  • msg Object

performTaskFunctionalityWithWebWorker

(
  • task
)
private

Performs the tasks performTask functionality within a web worker

Parameters:

serialize

(
  • o
)
String private

Variation of http://blog.stchur.com/2007/04/06/serializing-objects-in-javascript/

Parameters:

  • o Object

Returns:

String: Serialized string representation of the passed object

whenTaskDecorator

(
  • task
)
private

The task doesnt execute until the when method provided returns true.

Parameters:

  • task Object

whileTaskDecorator

(
  • task
)
private

Decorator to provide while loop functionaliy. The task executed until the while method returns false.

Parameters:

  • task Object

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.