samedi 21 février 2015

Build methods with async

I know I can use async or bluebird but really do not know how


I have the follow



function Builder()
{
}

Builder.prototype.heavyProcess ...
Builder.prototype.ioProcessAfterHeavyProcess ...
Builder.prototype.afterHeavyProcessTwo ...
Builder.prototype.afterIoProcess ...


for the Builder.heavyProcess i do in sync way (I think so) for the ioProcessAfterHeavyProcess i'm using async.waterfall



function ioProcessAfterHeavyProcess(cb) {
async.waterfall([
function(callback) {
heavyProcess(...);
callback(...);
},
function(callback) {
callback(...);
}
], cb);
}


but i dont know how to do with afterIoProcess


Aucun commentaire:

Enregistrer un commentaire