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

support worker execArgv #356

Closed
MrPupik opened this issue Oct 19, 2022 · 2 comments
Closed

support worker execArgv #356

MrPupik opened this issue Oct 19, 2022 · 2 comments

Comments

@MrPupik
Copy link

MrPupik commented Oct 19, 2022

I'm using workerpool in nodejs with worker_threads. I've noticed that threads does not throw errors.
after some digging I noticed that my thread is running async function and that he default thread behavior for UnhandledPromiseRejection is not to exit.

to support this, worker_thread has execArgv parameter:
const worker = new Worker(__filename, { execArgv: [...process.execArgv, '--unhandled-rejections=strict' ] })

see full discussion here

Could you support such option somehow? currently I'm implementing specific handleThreadError function for this

@josdejong
Copy link
Owner

Ah, good point. So, the library does have support for passing options like execArgv to child_process: forkArgs and forkOpts, but something similar for the execArgv of worker_thread is missing, right? Makes sense to add support for that.

Anyone interested in working this out in a PR? Help would be welcome.

@josdejong
Copy link
Owner

This is addressed now in v6.3.0 thanks to #357

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

No branches or pull requests

2 participants