Class: WKcAysnc

$wk$. WKcAysnc

new WKcAysnc() → {Object}

$wk$.WKcAsync is a class the objects of which serialize asynchronous tasks.

Each object of this class defines a queue and a pool where asynchrounous tasks can be put.

By means of the method push a asynchronous task is enqueue. It is executed as soon as all tasks that have been enqueued earlier have finished.

By means of the method add a named asynchronous task is added to the task pool. Additionally, the ids of all tasks, the new task depends on, have to be stated. The task is executed as soon as all tasks it depends on have finished.

Source:
Returns:
A new async object.
Type
Object

Methods

add(p_id, p_ids, p_env, p_doit, p_args) → {Object}

Adds new asynchronous tasks to the task pool. That task is executed as soons as all tasks it depends on have finished.
Parameters:
Name Type Argument Description
p_id String The id of the task. It is not possible to add a second task with the same id as an elder task. In that case an error is dispatched;
p_ids Array.<String> | Array <optional>
The ids of those tasks, the new task depends on.
p_env Object <optional>
The environment which can be accessed via this.
p_doit function The function that performs a task asynchronously
p_args Object[] The arguments passed to p_doit when executed. Every function for which the property NO_CALLBACK has either not been set or is not equal to true is considered to be a callback function. p_doit must call at least one callback function. If no function has been stated, an callback function is created automatically and passed as last argument to doit.
Source:
Returns:
this
Type
Object

push(p_env, p_doit, p_args) → {Object}

Enqueues new asynchronous tasks. That task is executed as soons as all tasks that have been enqueue before have finished.
Parameters:
Name Type Argument Description
p_env Object <optional>
The environment which can be accessed via this.
p_doit function The function that performs a task asynchronously
p_args Object[] The arguments passed to p_doit when executed. Every function for which the property NO_CALLBACK has either not been set or is not equal to true is considered to be a callback function. p_doit must call at least one callback function. If no function has been stated, an callback function is created automatically and passed as last argument to doit.
Source:
Returns:
this
Type
Object
W. Kowarschick © 2013 (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/)
Documentation generated by JSDoc 3.3.0-dev on Sat Oct 05 2013 15:14:39 GMT+0200 (MESZ) using the DocStrap template.