事件:'message'
¥Event: 'message'
当工作线程调用 require('node:worker_threads').parentPort.postMessage() 时,则会触发 'message' 事件。详情请见 port.on('message') 事件。
¥The 'message' event is emitted when the worker thread has invoked
require('node:worker_threads').parentPort.postMessage().
See the port.on('message') event for more details.
在 Worker 对象上触发 'exit' 事件 之前,从工作线程发送的所有消息都会触发。
¥All messages sent from the worker thread are emitted before the
'exit' event is emitted on the Worker object.