事件:'message'
【Event: 'message'】
message<Object> 一个解析后的 JSON 对象或原始值。sendHandle<Handle> | <undefined> 是undefined或net.Socket、net.Server或dgram.Socket对象。
当子进程使用 process.send() 发送消息时,会触发 'message' 事件。
【The 'message' event is triggered when a child process uses
process.send() to send messages.】
消息会经过序列化和解析。最终得到的消息可能与最初发送的内容不完全相同。
【The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent.】
如果在生成子进程时将 serialization 选项设置为 'advanced',则 message 参数可以包含 JSON 无法表示的数据。有关更多详细信息,请参见 高级序列化。
【If the serialization option was set to 'advanced' used when spawning the
child process, the message argument can contain data that JSON is not able
to represent.
See Advanced serialization for more details.】