You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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' ] })
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.
I'm using
workerpool
in nodejs withworker_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
hasexecArgv
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 thisThe text was updated successfully, but these errors were encountered: