Artyom Ionash
Artyom Ionash

Reputation: 458

How to organize a multiprocess application in Node.js?

The source code is as follows:

const listener = new Listener ();

listener.start ();    

process.on ('SIGTERM', () => {
  listener.stop ();
});

I want to split Listener into two, in order to bring the code to a child process.

How to do this properly using Node.js?

Upvotes: 0

Views: 172

Answers (1)

HRK44
HRK44

Reputation: 2782

Your question is a bit broad, but you should look into node clustering - which is the built-in framework to handle child processes : https://nodejs.org/api/cluster.html

Upvotes: 1

Related Questions