Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make module context-aware #11

Merged
merged 1 commit into from
Oct 24, 2018
Merged

Make module context-aware #11

merged 1 commit into from
Oct 24, 2018

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.

None yet

2 participants