Open camnewnham opened 1 month ago
I can reproduce this. While destroying one environment and then creating another will work, creating a second concurrent environment crashes.
@vmoroz It should be supported, right? Can you try adding a test case for this in the libnode PR?
@camnewnham , I am currently working on the new version of the libnode
API and I have faced the same issue. The root cause is that the Inspector (JS debugger) can be associated only with a single root environment. Using multiple environment requires to explicitly disable the Inspector. There is a test/embedding/embedtest_concurrent_node_api.cc
file to test the multiple runtimes in the PR.
The issue should be addressed in the new version of the API. The plan is adopt it in the node-api-dotnet project as soon as we complete the key outstanding TODOs. I.e. maybe even before the PR is merged. This is to be sure sure that the new API can be integrated well with .Net.
@camnewnham , I am also looking for real life scenarios for the libnode
API to make sure that it addresses the real needs.
I wonder if you could share high level ideas about what you would like to get from that API.
The docs suggest that multiple environments can exist concurrently for the sample platform.
I get an assertion failure from this simple console application:
libnode was built with the instructions and is using the suggested
napi-libnode-v20.9.0
branch.