josdejong / workerpool

Offload tasks to a pool of workers on node.js and in the browser
Apache License 2.0
2.06k stars 147 forks source link

Support for passing options to web worker constructor #400

Closed DonatJR closed 1 year ago

DonatJR commented 1 year ago

Add the ability to pass options to web worker constructor: see #322 for initial request and #329 for previous PR.

I am not sure about typing the WorkerOptions in src/types.js, since they are taken straight from the spec and would need to be updated if the spec ever changes. Should I replace them with a generic * like forkArgs and forkOpts?

josdejong commented 1 year ago

Thanks Jonas, this looks straightforward and well documented, including a clear example!

I like that you worked out the types for WorkerOptions. I think they will not change quickly, and if so, we can always update.

josdejong commented 1 year ago

Published now in v6.5.0, thanks again!

DonatJR commented 1 year ago

@josdejong Thank you for merging and publishing so fast, cheers! 🎉