Skip to content

Commit 0509360

Browse files
Flarnatargos
authored andcommitted
doc: change worker.takeHeapSnapshot to getHeapSnapshot
Adapt doc to match implementation which exports getHeapSnapshot(). PR-URL: nodejs#32061 Refs: nodejs#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]>
1 parent 2cba792 commit 0509360

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

doc/api/worker_threads.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,21 @@ added: v10.5.0
612612
The `'online'` event is emitted when the worker thread has started executing
613613
JavaScript code.
614614

615+
### `worker.getHeapSnapshot()`
616+
<!-- YAML
617+
added: REPLACEME
618+
-->
619+
620+
* Returns: {Promise} A promise for a Readable Stream containing
621+
a V8 heap snapshot
622+
623+
Returns a readable stream for a V8 snapshot of the current state of the Worker.
624+
See [`v8.getHeapSnapshot()`][] for more details.
625+
626+
If the Worker thread is no longer running, which may occur before the
627+
[`'exit'` event][] is emitted, the returned `Promise` will be rejected
628+
immediately with an [`ERR_WORKER_NOT_RUNNING`][] error.
629+
615630
### `worker.postMessage(value[, transferList])`
616631
<!-- YAML
617632
added: v10.5.0
@@ -684,21 +699,6 @@ inside the worker thread. If `stdout: true` was not passed to the
684699
[`Worker`][] constructor, then data will be piped to the parent thread's
685700
[`process.stdout`][] stream.
686701

687-
### `worker.takeHeapSnapshot()`
688-
<!-- YAML
689-
added: REPLACEME
690-
-->
691-
692-
* Returns: {Promise} A promise for a Readable Stream containing
693-
a V8 heap snapshot
694-
695-
Returns a readable stream for a V8 snapshot of the current state of the Worker.
696-
See [`v8.getHeapSnapshot()`][] for more details.
697-
698-
If the Worker thread is no longer running, which may occur before the
699-
[`'exit'` event][] is emitted, the returned `Promise` will be rejected
700-
immediately with an [`ERR_WORKER_NOT_RUNNING`][] error.
701-
702702
### `worker.terminate()`
703703
<!-- YAML
704704
added: v10.5.0

0 commit comments

Comments
 (0)