'message' 事件


如果 Node.js 进程是使用 IPC 通道衍生的(详见子进程集群文档),则当子进程接收到父进程使用 childprocess.send() 发送的消息时触发。

消息会进行序列化和解析,收到的消息可能与发送的不完全一样。

If the Node.js process is spawned with an IPC channel (see the Child Process and Cluster documentation), the 'message' event is emitted whenever a message sent by a parent process using childprocess.send() is received by the child process.

The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent.