From 50fb0199cd274b177e596310018aa02c8067bcb2 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 58e79c6e9933de..ae0b0b09d06926 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -4755,6 +4755,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