andywer / threads.js

🧵 Make web workers & worker threads as simple as a function call.
https://threads.js.org/
MIT License
3.04k stars 161 forks source link

Force to use tiny-worker on latest node.js #422

Open SonahtQ opened 2 years ago

SonahtQ commented 2 years ago

Is it possible to force threads.js to use tiny-worker even on latests versions of node.js? The reason is that in worker_threads still not works everything. For example You can't use canvas (node-canvas) in worker_thread. As far as I know tiny-worker uses child_processes as core mechanism so canvas then should works.

flux627 commented 2 years ago

Would love this. Currently I'm being forced to downgrade my Node version to 10.24.1, which means I need to use ESM to run my code. Kind of a mess. Unfortunately still nicer than rolling my own.

Would also love to be able to remove the Node worker_threads not available. Trying to fall back to tiny-worker polyfill... warning.

flux627 commented 2 years ago

This PR was made to enable this feature, but it stalled: #290