-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
AsyncWorkers prevent Node.js from exiting #25
Comments
Oh nice, I thought I'd eventually implement this myself but cool that you already did 😅 I think it's still better at some point to implement as much as possible upstream in Emscripten though - in particular, there is no reason not to add the refcounter to |
Agree with you. But I'm not familiar with how to contribute emscripten codebase, and it may be not easy to pull some dependencies due to the network environment limitation in China mainland. Could you help take this to emscripten? In addition, is there a better way than using |
I don't think it uses any special dependencies outside of what emsdk has (Python and Node.js + some modules). Not sure if any of those modules are blocked in China, but worth a try. But yeah, I can try and can help myself too.
Oh... you're using setInterval? Where? That definitely shouldn't be necessary. |
emnapi/packages/runtime/src/Context.ts Lines 80 to 99 in adbc3d0
I didn't think of any other way at the time. All the emnapi async worker threads should be unreffed, but there must be a strong ref to prevent nodejs from exiting the event loop. |
Yeah I was thinking on it before for the mentioned contribution, and I thought I'd go with That is, just do |
Thanks, learned from you again |
lovell/sharp#3522
https://github.com/lovell/sharp/pull/3522/files#diff-f1d20c9f37b79bd0729e7379d212de61e425488d7ceb987ed964326f874d7c43R44-R66
The text was updated successfully, but these errors were encountered: