react-worker-image icon indicating copy to clipboard operation
react-worker-image copied to clipboard

Limit Workers to max. avail. CPUs

Open kurtextrem opened this issue 7 years ago • 4 comments

Fixes #10

kurtextrem avatar Feb 10 '18 17:02 kurtextrem

Each IMageWorker component will now spawn 4 worker threads. As we've removed the worker.terminate call, will those threads still be active when a componentWillUnMount gets called?

nitish24p avatar Feb 10 '18 18:02 nitish24p

can you run npm run eslint to see the lint errors and fix those

nitish24p avatar Feb 10 '18 18:02 nitish24p

@nitish24p I fixed the mistakes, sorry for those, I was in a hurry.

kurtextrem avatar Feb 10 '18 20:02 kurtextrem

There's a big flaw in my current implementation: .onmessage can only exist once it seems. Which means currently ever new instance of ImageWorker replaces the callback function. ~~This means we need something like a Observer pattern.~~

Edit: I've overlooked, that Workers have the .addEventListener interface too, so that's not a problem anymore.

kurtextrem avatar Feb 14 '18 10:02 kurtextrem