https://stackoverflow.com/questions/45624671/communication-between-child-processes-in-node-js
https://stackoverflow.com/questions/33334436/send-messages-from-child-to-parent-process
fork를 사용하는 방법 (spawn 아님)
import cp from 'child_process';
const child = cp.fork(this.serviceEntry, [], {
stdio: ['ipc'],
});
child.kill();
// parent -> child
child.send(message);
// child -> parent
child.on('message', (message) => {
...
});
// process.send가 있으면 child process임
if(process.send) {
// child -> parent
process.send(message);
// parent -> child
process.on('message', (message) => {
...
});
}