From a03d2b5501c5975c885c94f7a8ab45bb410cc8f9 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Tue, 9 Jun 2020 10:53:47 +0200 Subject: [PATCH] n-api: document nextTick timing in callbacks PR-URL: https://github.com/nodejs/node/pull/33804 Reviewed-By: Matteo Collina Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Gabriel Schulhof Reviewed-By: Michael Dawson --- doc/api/n-api.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 80344566e68d61..e30c1e87fc75bb 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -4751,6 +4751,9 @@ is sufficient and appropriate. Use of the `napi_make_callback` function may be required when implementing custom async behavior that does not use `napi_create_async_work`. +Any `process.nextTick`s or Promises scheduled on the microtask queue by +JavaScript during the callback are ran before returning back to C/C++. + ### napi_open_callback_scope