worker.getHeapSnapshot([options])
返回一个可读流,用于获取当前 Worker 状态的 V8 快照。更多详情请参见 v8.getHeapSnapshot()。
【Returns a readable stream for a V8 snapshot of the current state of the Worker.
See v8.getHeapSnapshot() for more details.】
如果 Worker 线程不再运行,这可能会在 'exit' 事件 发出之前发生,返回的 Promise 会立即以 ERR_WORKER_NOT_RUNNING 错误被拒绝。
【If the Worker thread is no longer running, which may occur before the
'exit' event is emitted, the returned Promise is rejected
immediately with an ERR_WORKER_NOT_RUNNING error.】