Skip to content

Conversation

@mattolson
Copy link
Contributor

In order to load the module in multiple contexts, such as in a parent thread and a worker thread, we need to be context-aware.

Fixes #10

References

@schroffl
Copy link
Owner

schroffl commented Oct 22, 2018

Have you tested it? I don't doubt that you did, but I'd be rather safe than sorry.
If you want to, you can also add a Context-Awareness test using mocha. Otherwise I can take care of it, though I am not sure when. It's not a necessity and I will still publish a fix tomorrow, but future-proofing is always a good idea :)

Thank you very much for all your contributions so far!

@mattolson
Copy link
Contributor Author

Yes, I tested it locally using the code posted here: #10 (comment)

I will add a test to the PR as well.

* In order to load the module in multiple contexts, such as
  in a parent thread and a worker thread, we need to be
  context-aware.
* https://nodejs.org/api/addons.html#addons_context_aware_addons
@mattolson
Copy link
Contributor Author

@schroffl I have added a test to demonstrate that the module will load correctly twice from the same process. This test fails with Error: Module did not self-register if run against master.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants