Question

I am using Q_oper8 in node.js to runs jobs in a queue using a pool of processes . It works fine if i return the data from actionMethod .But when I use any call back function to return data in actionMethod it does not work.

Can any one help me out ? Thanks.

Was it helpful?

Solution

After looking into the library I found the solution. you need to have actionMethod(action,fnReturnResponse) as childPrecess Handler.

And what ever you need to return , you can return from your callback function by calling fnReturnResponse(returnValue);

You will also need to pass second argument of childProcess handler to be true (stands for isAsync)

childProcess.handler(actionMethod,true);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top