From 08bd4b45266a5784807048419a5539ce3c4df24b Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 6 Jun 2023 15:18:30 -0400 Subject: [PATCH 1/3] doc: add additional info on TSFN dispatch Refs: https://github.com/nodejs/node/issues/48356 Signed-off-by: Michael Dawson --- doc/api/n-api.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index a96b1be67c5889..41b0f0a19aaced 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6070,6 +6070,11 @@ Node.js process exits while there is a thread-safe function still active. It is not necessary to call into JavaScript via `napi_make_callback()` because Node-API runs `call_js_cb` in a context appropriate for callbacks. +Zero or more queued callbacks may be invoked in each tick of the event queue. +Applications should not depend on a specific behaviour other than progress in +invoking callbacks will be made and events will be invoked +as time moves forward. + ### Reference counting of thread-safe functions Threads can be added to and removed from a `napi_threadsafe_function` object From 39b665ef6b3ee014cb5a3373dd188906f2d7a537 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 8 Jun 2023 15:19:11 -0400 Subject: [PATCH 2/3] Update doc/api/n-api.md Co-authored-by: Chengzhong Wu --- doc/api/n-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 41b0f0a19aaced..0f5cf5824be76f 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6070,7 +6070,7 @@ Node.js process exits while there is a thread-safe function still active. It is not necessary to call into JavaScript via `napi_make_callback()` because Node-API runs `call_js_cb` in a context appropriate for callbacks. -Zero or more queued callbacks may be invoked in each tick of the event queue. +Zero or more queued items may be invoked in each tick of the event loop. Applications should not depend on a specific behaviour other than progress in invoking callbacks will be made and events will be invoked as time moves forward. From 668d6e88feeb749593f9b1ca6baa641592f76ba2 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 9 Jun 2023 13:22:38 -0400 Subject: [PATCH 3/3] Update doc/api/n-api.md Co-authored-by: Mohammed Keyvanzadeh --- doc/api/n-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 0f5cf5824be76f..817dbcb2d52357 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6071,7 +6071,7 @@ It is not necessary to call into JavaScript via `napi_make_callback()` because Node-API runs `call_js_cb` in a context appropriate for callbacks. Zero or more queued items may be invoked in each tick of the event loop. -Applications should not depend on a specific behaviour other than progress in +Applications should not depend on a specific behavior other than progress in invoking callbacks will be made and events will be invoked as time moves forward.