Wednesday, 15 February 2012

node.js - Series flow with Async in NodeJS gets asynchrounously called -



node.js - Series flow with Async in NodeJS gets asynchrounously called -

i need phone call 3 functions in series x1() x2() x3(). since x1 , x2 time consuming operations x3 executes before them giving unexpected results. have used async library in nodejs series method below. how can solve without using settimeout x3()

async.series([function(callback) { x1();callback(null, null);}, function(callback) { x2();callback(null, null);}, function(callback) { x3(); callback(null, null); }], function(err, results) { } );

use recursive seek catch..

a=true; while(a){ try{ work..... a=false; }catch(exp ){ a=true } }

node.js asynchronous

No comments:

Post a Comment