Tuesday, 2 May 2017

May I send argument to the process.send callback?

I'm playing with node.js and I have a doubt about the process.send method from the node.js process module. https://nodejs.org/dist/latest-v4.x/docs/api/process.html#process_process_send_message_sendhandle_callback (This is the current node.js version I'm playing with)

In the node.js documentation I saw there is a callback argument in the process.send method. I understand the callback is called after send the message, but I don't see anything about the callback function arguments. My doubt is: Can I send arguments to the callback function via message handler?

Suppose I have a cluster and I would like to send a message from a worker to the master and get a value back. May I set a arguments to the process.send callback argument function from the message handler in the master?



via vanz

No comments:

Post a Comment