setImmediate() for N-API code
$ npm install setimmediate-napi
"<!@(node -p \"require('setimmediate-napi').include\")" somewhere in that list, ok?)
In your C++ code:
int a = 10;);
Keep in mind:
- You need to use
References to keep track of JS objects, since this code runs asynchronously.
Callto make sure Node.js can track your async context.
- This function can be invoked even when executing JS code itself is not allowed.