This file is an overview for C embedding API. It is mostly to catch all the work in progress.
node_embedding_on_error
node_embedding_set_api_versionnode_embedding_run_mainnode_embedding_create_platformnode_embedding_delete_platformnode_embedding_platform_set_flagsnode_embedding_platform_get_parsed_args
node_embedding_run_runtimenode_embedding_create_runtimenode_embedding_delete_runtimenode_embedding_runtime_set_flagsnode_embedding_runtime_set_argsnode_embedding_runtime_on_preloadnode_embedding_runtime_on_start_executionnode_embedding_runtime_add_module- add API to handle unhandled exceptions
node_embedding_on_wake_up_event_loopnode_embedding_run_event_loopnode_embedding_complete_event_loop- add API for emitting
beforeExitevent - add API for emitting
exitevent - add API to stop the event loop
node_embedding_run_node_apinode_embedding_open_node_api_scopenode_embedding_close_node_api_scope
-
Global handling of C API errors
-
Global handling of Node.js/V8 errors (is it possible?)
-
Global handling of unhandled JS errors
-
API version
-
Node-API version
-
Global platform initialization
-
Global platform uninitialization
-
Parsing the command line parameters
-
Controlled by the platform flags
-
Get parsed command line arguments
-
Can we initialize platform again if it returns early?
-
[-] Will not support: custom thread pool
-
API v-table to avoid DLL named function binding
-
Runtime initialization
-
Runtime uninitialization
-
Set runtime args
-
Set runtime flags
-
Register a preload callback
-
Register start execution callback
-
Load default Node.js snapshot without the custom start execution callback
-
Get the returned value from the start execution
-
Register linked modules
-
Runtime handling of API errors (is it possible?)
-
Runtime handling of Node.js/V8 errors (is it possible?)
-
Runtime handling of unhandled JS errors
-
Events on Runtime destruction (beforeExit, exit)
-
Main vs secondary Runtimes
-
Worker thread runtimes (is it possible?)
-
Associate Inspector with the Runtime
-
Inspector for the secondary Runtimes
-
Runtime destructor to clean up all related resources including the pending tasks.
-
Exit process only for unhandled main runtime errors.
-
Have an internal list of all runtimes in the system. It is a list of all secondary runtimes attached to the main runtime.
- Run event loop while it has events (default)
- Run event loop once and block for an event
- Run event loop once and no wait
- Run event loop till completion
- Interrupt the event loop (uv_stop stops the default loop and then the loop resets it)
- Loop while some condition is true
- Custom foreground task runner (is it possible?)
- Notify if event loop has work to do (based on Electron PollEvents) It must be blocked while the loop is running It is only for the main runtime
- V8 Microtask posting and draining
- Complete the loop immediately if needed
- Protect from nested uv_run calls
- How to post setImmediate from another thread?
- Run Node-API code as a lambda
- Explicitly open and close the Node-API scope
- Handle JS errors
- Test passing the V8 thread pool size.
- Add tests based on the environment and platform
cctests. - Enable the test_main_modules_node_api test.
- Test failure in Preload callback.
- Test failure in linked modules.
- Add a test that handles JS errors.
- Make sure that the the delete calls match the create calls.