API Docs for: 0.1.0
Show:

mclib.ProcessList Class

Creates a list of processes that will be executed asynchronously but in order.

Constructor

mclib.ProcessList

(
  • timeout
)

Parameters:

  • timeout Float

    Amount of time between processing.

Item Index

Methods

Methods

_execute

() private

Execute the next process in the list.

add

(
  • process
  • argsObj
)

Parameters:

  • process Function

    A function that will be called asynchronously.

  • argsObj Object

    An object containing the parameters that will be passed that function.

Example:

            var list = new mclib.ProcessList();
            list.add(function1,argsObj);

            var function1 = function (argsObj) {
                        alert(argsObj.title + " " + argsObj.name);
                      };

           list.add(function1, {title: "Mr", name: "Michael Cornetto");

Events

invalid

Event that is triggered when a process is invalid.

Example:

 var list = new mclib.ProcessList();
 list.add(function1,argsObj);

 var handler = function (argsObj) {
             //nothing is passed
             alert("Invalid process encounterd " + argsObj.process );
           };

list.invalid.addHandler(handler);

listEmpty

Event that is triggered when the ProcessList has emptied.

Example:

 var list = new mclib.ProcessList();
 list.add(function1, argsObj);

 var handler = function () {
             //nothing is passed
             alert("Finished processing");
           };

list.listEmpty.addHandler(handler);

progress

Event that is triggered at the end of each execution.

Example:

 var list = new mclib.ProcessList();
 list.add(function1,argsObj);

 var handler = function (argsObj) {
             //nothing is passed
             alert("Processed this many " + argsObj.processed );
           };

list.progress.addHandler(handler);