Skip to content

Commit fdad4d2

Browse files
addaleaxBridgeAR
authored andcommitted
doc: document diverging MessagePort.onmessage handling
Fixes: #26463 PR-URL: #26487 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 73370b4 commit fdad4d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: doc/api/worker_threads.md

+3
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)