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.

有帮助吗?

解决方案

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);

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top