GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: clarify async execute callback usage · nodejs/node@df0f7a3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • n-api.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+13-1Lines changed: 13 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ operations. Callback functions must statisfy the following signature:
179179
typedef void (*napi_async_execute_callback)(napi_env env, void* data);
180180
```
181181

182+
Implementations of this type of function should avoid making any N-API calls
183+
that could result in the execution of JavaScript or interaction with
184+
JavaScript objects. Most often, any code that needs to make N-API
185+
calls should be made in `napi_async_complete_callback` instead.
186+
182187
#### napi_async_complete_callback
183188
Function pointer used with functions that support asynchronous
184189
operations. Callback functions must statisfy the following signature:
@@ -3322,7 +3327,14 @@ asynchronous workers. Instances are created/deleted with
33223327

33233328
The `execute` and `complete` callbacks are functions that will be
33243329
invoked when the executor is ready to execute and when it completes its
3325-
task respectively. These functions implement the following interfaces:
3330+
task respectively.
3331+
3332+
The `execute` function should avoid making any N-API calls
3333+
that could result in the execution of JavaScript or interaction with
3334+
JavaScript objects. Most often, any code that needs to make N-API
3335+
calls should be made in `complete` callback instead.
3336+
3337+
These functions implement the following interfaces:
33263338

33273339
```C
33283340
typedef void (*napi_async_execute_callback)(napi_env env,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.