summaryrefslogtreecommitdiff
path: root/doc/api/worker_threads.md
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-10 12:12:59 +0100
committerAnna Henningsen <anna@addaleax.net>2019-03-11 09:57:02 +0000
commit137d3d2734a6f6e891ebab68ec6da16c8a6b397c (patch)
treeb0b68572ffe14ca0567abc22daa198e1a96e9633 /doc/api/worker_threads.md
parenta52aedeae08b57daedae56fd818be09df5f32e86 (diff)
downloadandroid-node-v8-137d3d2734a6f6e891ebab68ec6da16c8a6b397c.tar.gz
android-node-v8-137d3d2734a6f6e891ebab68ec6da16c8a6b397c.tar.bz2
android-node-v8-137d3d2734a6f6e891ebab68ec6da16c8a6b397c.zip
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>
Diffstat (limited to 'doc/api/worker_threads.md')
-rw-r--r--doc/api/worker_threads.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md
index 8d4c703f48..5152cc8c4d 100644
--- a/doc/api/worker_threads.md
+++ b/doc/api/worker_threads.md
@@ -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