高级前端
node
【Q239】Node 如何进行进程间通信

Node 如何进行进程间通信

Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 240 (opens in a new tab)

Author 回答者: shfshanyue (opens in a new tab)

对于 spawn/fork 出来的父子进程来说,可以通过 pipe 的方式

  • process.on('message')/process.send
  • stdin.on/stdout.write

对于并无相关的进程

  • socket
  • message queue