Skip to content

Commit 5b894fd

Browse files
authored
fixup!
1 parent f5ec204 commit 5b894fd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎doc/api/globals.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,9 +1401,9 @@ Inside a worker, \[`worker_threads.parentPort`]\[] is the port behind
14011401
`self.postMessage()` and the worker's `message` events, `isMainThread` is
14021402
`false`, and `workerData` is `undefined`.
14031403

1404-
Because that thread keeps the event loop alive, `Worker` instances can be
1405-
mutated using the non-standard `process.ref(worker)` and `process.unref(worker)`
1406-
methods.
1404+
Web Workers, like `node:worker_threads` workers, keep the event loop alive by
1405+
default. In Node.js, Web Workers implement the [Refable protocol][], and can be
1406+
ref'd and unref'd using `process.ref(worker)` and `process.unref(worker)`.
14071407

14081408
As a rule of thumb, use [`node:worker_threads`][] directly when a program
14091409
needs `workerData`, a custom `env` or `execArgv`, resource limits, stdio
@@ -1460,6 +1460,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
14601460
[ECMAScript module]: esm.md
14611461
[HTML Standard]: https://html.spec.whatwg.org/multipage/workers.html
14621462
[Navigator API]: https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object
1463+
[Refable protocol]: process.md#processrefmayberefable
14631464
[RFC 5646]: https://www.rfc-editor.org/rfc/rfc5646.txt
14641465
[Web Crypto API]: webcrypto.md
14651466
[`--experimental-eventsource`]: cli.md#--experimental-eventsource

0 commit comments

Comments
 (0)