Class Index | File Index

## Classes

- _global_
- comb
- comb.array
- comb.characters
- comb.collections
- comb.collections.AnderssonTree
- comb.collections.AVLTree
- comb.collections.BinaryTree
- comb.collections.Collection
- comb.collections.HashTable
- comb.collections.Heap
- comb.collections.Iterable
- comb.collections.MaxHeap
- comb.collections.MinHeap
- comb.collections.Pool
- comb.collections.PriorityQueue
- comb.collections.Queue
- comb.collections.RedBlackTree
- comb.collections.Stack
- comb.collections.Tree
- comb.date
- comb.logging
- comb.logging.appenders
- comb.logging.appenders.Appender
- comb.logging.appenders.ConsoleAppender
- comb.logging.appenders.FileAppender
- comb.logging.appenders.JSONAppender
- comb.logging.appenders.RollingFileAppender
- comb.logging.BasicConfigurator
- comb.logging.Level
- comb.logging.Logger
- comb.logging.PropertyConfigurator
- comb.number
- comb.plugins
- comb.plugins.Broadcaster
- comb.plugins.Middleware
- comb.Promise
- comb.PromiseList
- comb.regexp
- comb.string

# Class comb.PromiseList

Extends comb.Promise.
Defined in: promise.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| comb.PromiseList(defs) PromiseList object used for handling a list of Promises

Methods borrowed from class comb.Promise:
  addCallback, addErrback, callback, chain, errback, then

Class Detail
comb.PromiseList(defs)
PromiseList object used for handling a list of Promises

            var myFunc = function(){
                 var promise = new Promise();
                 //callback the promise after 10 Secs
                 setTimeout(hitch(promise, "callback"), 10000);
                 return promise;
             }
             var myFunc2 = function(){
                 var promises =[];
                 for(var i = 0; i < 10; i++){
                     promises.push(myFunc);
                 }
                 //create a new promise list with all 10 promises
                 return new PromiseList(promises);
             }
             var pl = new comb.PomiseList([myFunc(), myFunc2()]);
             pl.then(do something...)
             pl.addCallback(do something...)
             pl.cain(myfunc).then(do something...)
             pl.cain(myfunc).addCallback(do something...)

Parameters:
{comb.Promise[]} defs Optional, Default: []
  the list of promises

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 13:20:07 GMT-0500 (CDT)