Skip to content

Commit

Permalink
doc: change worker.takeHeapSnapshot to getHeapSnapshot
Browse files Browse the repository at this point in the history
Adapt doc to match implementation which exports getHeapSnapshot().

PR-URL: #32061
Refs: #31569
Refs: https://github.com/nodejs/node/blob/987a67339518d0380177a2e589f2bbd274230d0e/lib/internal/worker.js#L323
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
Flarna authored and MylesBorins committed Mar 10, 2020
1 parent 3c06316 commit bc1e357
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,21 @@ added: v10.5.0
The `'online'` event is emitted when the worker thread has started executing
JavaScript code.

### `worker.getHeapSnapshot()`
<!-- YAML
added: v13.9.0
-->

* 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` will be rejected
immediately with an [`ERR_WORKER_NOT_RUNNING`][] error.

### `worker.postMessage(value[, transferList])`
<!-- YAML
added: v10.5.0
Expand Down Expand Up @@ -685,21 +700,6 @@ inside the worker thread. If `stdout: true` was not passed to the
[`Worker`][] constructor, then data will be piped to the parent thread's
[`process.stdout`][] stream.

### `worker.takeHeapSnapshot()`
<!-- YAML
added: v13.9.0
-->

* 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` will be rejected
immediately with an [`ERR_WORKER_NOT_RUNNING`][] error.

### `worker.terminate()`
<!-- YAML
added: v10.5.0
Expand Down

0 comments on commit bc1e357

Please sign in to comment.