-
Notifications
You must be signed in to change notification settings - Fork 72
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
Support for worker_threads? #157
Comments
Please ignore, I was implementing incorrectly. Thank you again for such a fantastic library! |
I was able to reproduce this issue. If you include node-lmdb in the parent process and in the worker thread then the error:Error: Module did not self-register. comes up. It looks like this is due to this: nodejs/node#21783 (comment) |
@kylebernhardy Does the suggested fix on the link really fix the issue? If it fixes it for you then you can make a pull request of it. |
It would entail converting the project from nan to n-api & in the implementation make the module context aware. I haven't seen anywhere that nan has support for making an addon context aware, but I can look into it. Is n-api something the team for this addon has been looking into? |
I've been out of the loop from node development lately, since I don't use it for any new project of mine. I had a quick glance at the docs and the context-aware thing doesn't seem to hard to do, so I believe it's worth to try it. Not sure what n-api is. |
I think I mis-read the needing to implement n-api. My C++ skills are rusty & I have not coded a native addon, but I am willing to give it a shot to implement. If you have any pointers as to where this needs to be added to the code base, please let me know. I'll keep you posted with my progress. |
@kylebernhardy Let me know how it goes. I'm unsure what exactly you are trying to do so I'm afraid I can't give you exact pointers about where in the code you should do it. |
@kylebernhardy, this should do the trick ;) My use-case was in electron renderers (with process reuse), I haven't tried it with worker_threads. Context-aware specific testing is most certainly needed... |
@d4tocchini , thanks! I'll check out your branch and see if it works in my use case. |
@kylebernhardy, see kriszyp#1 (comment) for caveats on worker_thread usage |
Support for threads/workers has been added in 0.9.4. I'd consider it beta, perhaps, but so far it seems to work properly, and I have done some decent load testing with it. Let me know if you see any issues. |
@kriszyp i can create a test branch on our product and run it thru some work loads to run you work thru it’s paces. Thank you so much |
Does node-lmdb support worker_threads? When I attempted to implement it into a simple test wher just node-lmdn is required I got the message Error: Module did not self-register.
The text was updated successfully, but these errors were encountered: