Reputation: 458
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
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