Skip to content

Conversation

@kraenhansen
Copy link
Member

@kraenhansen kraenhansen commented Jul 19, 2024

What, How & Why?

This closes #6772 by implementing a utils::Scheduler based on the Napi::ThreadSafeFunction primitive.

Note: In order for the uncaught exceptions thrown by the Node.js addon, the node process must be started with a --force-node-api-uncaught-exceptions-policy flag enabled. This was added under a flag to "not breaking existing running Node-API add-ons.".

https://github.com/nodejs/node/blob/cd39578e53d6502de03f15620d15835b86954ac8/src/node_api.cc#L85-L115

Alternatively the following warning will be logged:

(node:17922) [DEP0168] DeprecationWarning: Uncaught N-API callback exception detected, please run node with option --force-node-api-uncaught-exceptions-policy=true to handle those exceptions properly.

☑️ ToDos

@kraenhansen
Copy link
Member Author

I thought my implementation was done, but it turns out tests were still failing 🤔 This is likely never going to get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor throwing uncaught exceptions from callbacks dispatched onto the event loop from C++

2 participants