Skip to content

Commit 137d3d2

Browse files
committed
doc: document diverging MessagePort.onmessage handling
Fixes: #26463 PR-URL: #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>
1 parent a52aede commit 137d3d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/worker_threads.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ listeners are attached.
319319

320320
This method exists for parity with the Web `MessagePort` API. In Node.js,
321321
it is only useful for ignoring messages when no event listener is present.
322+
Node.js also diverges in its handling of `.onmessage`. Setting it will
323+
automatically call `.start()`, but unsetting it will let messages queue up
324+
until a new handler is set or the port is discarded.
322325

323326
### port.unref()
324327
<!-- YAML

0 commit comments

Comments
 (0)