Skip to content

Commit

Permalink
doc: document diverging MessagePort.onmessage handling
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Mar 10, 2019
1 parent 060b524 commit 77f6b8c
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 77f6b8c

Please sign in to comment.