napi_async_execute_callback


函数指针用于支持异步操作的函数。回调函数必须满足以下签名:

【Function pointer used with functions that support asynchronous operations. Callback functions must satisfy the following signature:】

typedef void (*napi_async_execute_callback)(napi_env env, void* data); 

该函数的实现必须避免调用执行 JavaScript 或与 JavaScript 对象交互的 Node-API。Node-API 调用应放在 napi_async_complete_callback 中。不要使用 napi_env 参数,因为这可能会导致执行 JavaScript。

【Implementations of this function must avoid making Node-API calls that execute JavaScript or interact with JavaScript objects. Node-API calls should be in the napi_async_complete_callback instead. Do not use the napi_env parameter as it will likely result in execution of JavaScript.】