From 28657cc614b6cacce59c1723c27ea88df7f21e50 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 5 Feb 2020 13:09:11 +0100 Subject: [PATCH] doc: clarify Worker exit/message event ordering Motivated by the fact that getting this wrong has led to flaky tests in our test suite. Refs: https://github.com/nodejs/node/pull/31637 PR-URL: https://github.com/nodejs/node/pull/31642 Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/worker_threads.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 8a04d6f3dc8c41..d2989a2eeb6538 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -582,6 +582,8 @@ exited by calling [`process.exit()`][], the `exitCode` parameter will be the passed exit code. If the worker was terminated, the `exitCode` parameter will be `1`. +This is the final event emitted by any `Worker` instance. + ### Event: `'message'`