-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
[feat] override stdout & stderr in worker_thread for debug worker #161
Comments
Well done, a PR with test cases will be appreciated. Keep in mind, the override should be executed only once if possible. |
Okay, I will add some test cases later and check whether this override only takes effect within the worker thread. |
fisker/make-synchronized#10 😄 Thanks for the idea! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the research based on the issue at jimmywarting/await-sync#1 (comment)
Worker threads in
Node.js
send their standard IO to the main thread for processing. When synchronous operations are implemented, the blocking of these operations can cause the logs of these worker threads to be synchronized and output only after the computation results are completed.Similarly, following the implementation of
whatwg-workers
, by rewriting the write methods ofstdout
andstderr
streams within worker threads, it is possible to allow the standard input and standard error within the worker threads to be directly written into the streams.and test demo output
If allowed, I'm glad to raise a pr
The text was updated successfully, but these errors were encountered: