Hacker News new | ask | show | jobs
by numlock86 1395 days ago
Most likely using the cluster module and your favorite IPC module.

https://nodejs.org/api/cluster.html

2 comments

My go-to method of inter-process communication in Node without using any third party modules is to just use process.send[1] to a send a message to the main thread, and then have it forward messages to the workers in the cluster, which you can listen for using the message event [2].

[1] https://nodejs.org/api/process.html#processsendmessage-sendh...

[2] https://nodejs.org/api/process.html#event-message