Re: [nodejs] how to synchronize two async.waterfall calls

2013-12-17 Thread Bruno Fuster
You can waterfall two waterfalls function createWaterfall(commands) { return function(callback) { Async.waterfall(commands, callback); } } var waterfalls = [createWaterfall(readCommands), createWaterfall(writeCommands)]; Async.waterfall(waterfalls, function(err) { //final result })

[nodejs] how to synchronize two async.waterfall calls

2013-12-17 Thread Reza Razavipour
I have a set of read commands that I have to in sequence. Any fails, processing stops. readCommands is an array of read functions... async.waterfall(readCommands, function(err) { if (err) { console.log(err); res.send(500, { error : err.toString(