Skip to content

Commit a534d82

Browse files
juanarbolBethGriggs
authored andcommitted
doc: add documentation for transferList arg at worker threads
Ref: #32278 PR-URL: #32881 Refs: #32278 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 184e80a commit a534d82

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/api/worker_threads.md

+5
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ changes:
564564
occur as described in the [HTML structured clone algorithm][], and an error
565565
will be thrown if the object cannot be cloned (e.g. because it contains
566566
`function`s).
567+
* `transferList` {Object[]} If one or more `MessagePort`-like objects
568+
are passed in `workerData`, a `transferList` is required for those
569+
items or [`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`][] will be thrown.
570+
See [`port.postMessage()`][] for more information.
567571
* `resourceLimits` {Object} An optional set of resource limits for the new
568572
JS engine instance. Reaching these limits will lead to termination of the
569573
`Worker` instance. These limits only affect the JS engine, and no external
@@ -751,6 +755,7 @@ active handle in the event system. If the worker is already `unref()`ed calling
751755
[`'exit'` event]: #worker_threads_event_exit
752756
[`AsyncResource`]: async_hooks.html#async_hooks_class_asyncresource
753757
[`Buffer`]: buffer.html
758+
[`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`]: errors.html#errors_err_missing_message_port_in_transfer_list
754759
[`ERR_WORKER_NOT_RUNNING`]: errors.html#ERR_WORKER_NOT_RUNNING
755760
[`EventEmitter`]: events.html
756761
[`EventTarget`]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget

0 commit comments

Comments
 (0)