News for hackers. Stuff that matters.
Re:Wait.for: Sequential programming for Node.js (beta) by lucio on Friday August 23, 2013 @12:36AM (#6261743)
- syntax

- wait.for it's simpler

- wait.for uses try/catch

I don't know async.series deeply, but, ¿how do you use results from the first function on the second or third?

wait.for:

  try{
    data = wait.for(function1);
    result = wait.for(function2, data);    
  }
  catch(err){
    // error handling
  };
async.series:

  async.series([
    function1,
    function2
    ],
    // optional callback
    function(err, results){
      // results is now equal to ['one', 'two']
    });
async has a lot of functionality. You can use wait.for and async at the same time. They supply different functionality.

Example:

  results = wait.for(async.map,['file1','file2','file3'], fs.stat);
Re:Wait.for: Sequential programming for Node.js (beta) by htilford on Friday August 23, 2013 @12:54AM (#6261782)
> ¿how do you use results from the first function on the second or third?

waterfall

  async.waterfall([
    function (cb) {
      . . .
      cb(stuff);
    },
    function (stuff, cb) {
      . . .