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:
Anna Henningsen 2019-03-10 12:12:59 +01:00
parent a52aedeae0
commit 137d3d2734
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -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