doc: document diverging MessagePort.onmessage handling
Fixes: https://github.com/nodejs/node/issues/26463 PR-URL: https://github.com/nodejs/node/pull/26487 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
a52aedeae0
commit
137d3d2734
@ -319,6 +319,9 @@ listeners are attached.
|
|||||||
|
|
||||||
This method exists for parity with the Web `MessagePort` API. In Node.js,
|
This method exists for parity with the Web `MessagePort` API. In Node.js,
|
||||||
it is only useful for ignoring messages when no event listener is present.
|
it is only useful for ignoring messages when no event listener is present.
|
||||||
|
Node.js also diverges in its handling of `.onmessage`. Setting it will
|
||||||
|
automatically call `.start()`, but unsetting it will let messages queue up
|
||||||
|
until a new handler is set or the port is discarded.
|
||||||
|
|
||||||
### port.unref()
|
### port.unref()
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
|
Loading…
x
Reference in New Issue
Block a user