vendredi 6 mars 2015

Unable to run functions in sync mode NODEJS

I am using the async module to run list of functions in sequence but only the first function named getBaseLineList gets executed. The second one does not ? I want them to run one after the other.


NodeJS



function getBaseLineList(){
var data=['a','b','c'];
console.log("Inside getBaseLineList");
return data;
}

function getBaseLineDetails(data){
console.log("After we get the list"+data);
}

var data =[];
async.series([
function(callback){
data = getBaseLineList();
},
function(callback){
getBaseLineDetails(data);
}
]);

app.listen(port, host);
console.log('App started on port ' + port);

Aucun commentaire:

Enregistrer un commentaire