Skip to content

Commit

Permalink
doc: document diverging MessagePort.onmessage handling
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
addaleax committed Mar 11, 2019
1 parent a52aede commit 137d3d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ listeners are attached.

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.
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()
<!-- YAML
Expand Down

0 comments on commit 137d3d2

Please sign in to comment.