worker.getHeapSnapshot()


  • 返回: <Promise> 对包含 V8 堆快照的可读流的 promise

返回工作线程当前状态的 V8 快照的可读流。 有关详细信息,请参阅 v8.getHeapSnapshot()

如果工作线程不再运行,这可能发生在 'exit' 事件触发之前,返回的 Promise 会立即使用 ERR_WORKER_NOT_RUNNING 错误拒绝。

  • Returns: <Promise> A promise for a Readable Stream containing a V8 heap snapshot

Returns a readable stream for a V8 snapshot of the current state of the Worker. See v8.getHeapSnapshot() for more details.

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.