#

API Docs for: 0.9.8
Show: Inherited Protected Private Deprecated

# MonkeyBars Class

- Index
- Methods
- Properties

## Item Index

### Methods

- createBlobWithTask
- createPropertyDescriptorsWithAttributes
- createSubTasksFromTaskOptionsArray
- createTaskWithOptions
- createWebWorkerWithBlobAndTask
- extend
- forTaskDecorator
- generateUniqueId
- isTaskDependentOnTask
- performTaskFunctionalityWithWebWorker
- resetTask
- serialize
- whenTaskDecorator
- whileTaskDecorator

### Properties

- LogLevels static
- MonkeyBars
- root
- TaskDecorators static
- taskIdCounter
- TaskStates static
- TaskTypes static

## Methods

### `createBlobWithTask`

(

- `task`

)
Blob private

Defined in `../monkeybars.js:293`

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

#### Parameters:

- `task` Task

#### Returns:

Blob: Blob instance

### `createPropertyDescriptorsWithAttributes`

(

- `attributes`

)
private

Defined in `../monkeybars.js:161`

Creates property descriptors from the passes attributes.

#### Parameters:

- `attributes` Object

### `createSubTasksFromTaskOptionsArray`

(

- `tasks`

)
private

Defined in `../monkeybars.js:144`

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

#### Parameters:

- `tasks` Array

### `createTaskWithOptions`

(

- `options`

)
private

Defined in `../monkeybars.js:85`

Creates task based on the options passed.

#### Parameters:

- `options` Object

### `createWebWorkerWithBlobAndTask`

(

- `blob`
- `task`

)
Worker private

Defined in `../monkeybars.js:328`

Creates a web Worker instance with the passed arguments

#### Parameters:

- `blob` Blob
- `task` Task

#### Returns:

Worker: WebWorker instance

### `extend`

(

- `protoProps`

)
Function

Defined in `../monkeybars.js:403`

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

Defined in `../monkeybars.js:1732`

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

Defined in `../monkeybars.js:200`

Generates a unique id for each task.

#### Parameters:

- `prefix` String

#### Returns:

String: tid

### `isTaskDependentOnTask`

(

- `task1`
- `task2`

)
private

Defined in `../monkeybars.js:214`

Determains whether the first task is dependent on the second.

#### Parameters:

- `task1` Task
- `task2` Task

### `performTaskFunctionalityWithWebWorker`

(

- `task`

)
private

Defined in `../monkeybars.js:374`

Performs the tasks `performTask` functionality within a web worker

#### Parameters:

- `task` Task

### `resetTask`

(

- `task`

)
private

Defined in `../monkeybars.js:181`

Resets the task to its original non executed state.

#### Parameters:

- `task` Task

### `serialize`

(

- `o`

)
String private

Defined in `../monkeybars.js:240`

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

Defined in `../monkeybars.js:1789`

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

#### Parameters:

- `task` Object

### `whileTaskDecorator`

(

- `task`

)
private

Defined in `../monkeybars.js:1758`

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

#### Parameters:

- `task` Object

## Properties

### `LogLevels`

Object static

Defined in `../monkeybars.js:1845`

Log level contstants.

### `MonkeyBars`

Object

Defined in `../monkeybars.js:63`

Object returned by module. Works as namespace for the task library.

### `root`

Object private

Defined in `../monkeybars.js:45`

Reference to the global js object (i.e. brower's window)

### `TaskDecorators`

Object static

Defined in `../monkeybars.js:1860`

Task decorators. These are exposed mainly to enable deeper extention.

### `taskIdCounter`

Integer private

Defined in `../monkeybars.js:54`

Counter used to create unique task ids

### `TaskStates`

Object static

Defined in `../monkeybars.js:1815`

Task states contstants.

### `TaskTypes`

Object static

Defined in `../monkeybars.js:1831`

Task types contstants.