1

I have used step even then function get called parallel, the execution should be in series please tell me where i am going wrong.

   //sample code
   var step=require('step')
   step(
   function first()
   {
   process();//calling function here
   return this; returning this to next function
   },
   function second()
   {
   process2();//calling another fun here
   return this;
   },
   function third()
   {
   process3();//calling function here
   return this; returning this to next function
   } 
   );//step end here

please help me. Thanks

2 Answers 2

1
var sync =require('async');
sync.series([
function(callback){
console.log("calling one");
callback(null, 'one');
},
function(callback){
console.log('two');
callback(null, 'two');
},
]);

Hello,

You have to synchronize these functions. Here step will not work for recursive functions.

Try this, Hop you will get you answer.

Sign up to request clarification or add additional context in comments.

Comments

0

Please go through the link:

Video: http://nodetuts.com/02-callback-pattern.html

Text: http://nodetuts.com/02-callback-pattern.html#-1

This may help you..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.