Closed dianlight closed 1 year ago
Hey @dianlight , Thanks for the feedback, it's super helpful. I totally agree that the issue you pointed out is a problem, and I'm on it. I'll let you know as soon as I have a solution.
I'm excited that you're interested in contributing in the future! Let's definitely keep in touch. If you have any other feedback or ideas, please don't hesitate to share.
Thanks again for your help, I really appreciate it!
Hi @dianlight ,
Thank you for your feedback. I have made the necessary changes to the library to ensure that the cancelAll, override, and overrideAfterCurrent methods send a cancellation request to the worker, enabling a smooth release of resources. Additionally, these methods now support a new parameter:
@param {boolean} force - If set to true, the worker will be terminated immediately without waiting for a response. This will result in a clean and available worker, ready to perform new tasks.
Furthermore, the issue of the worker being unusable after calling terminate has been resolved.
Thank you again for your valuable feedback and support.
Best regards,
hello, nice work. I've tried your library for an opensource project I'm following and it's very promising.
My 2 cents:
as per specs a terminated worker can't be used anymore so you should dereference it (browser garbage collector thanks you! :) ) and recreate it if you want it to still work.
currently your cancelAll function is final ( a new terminate! ) so override() can't work either.
The correct procedure should be (metacode).
Your code:
rif https://developer.mozilla.org/en-US/docs/Web/API/Worker rif https://www.w3schools.com/html/html5_webworkers.asp rif https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_webworker rif https://stackoverflow.com/questions/50350316/how-to-restart-web-worker-after-stop
Now I'm not able to contribute but from the end of April onwards if you want I can look at us and send you a PR.
in the meantime that you solve I would recommend you to document the fact that the functions are not working. Like me many might try it and see that it doesn't work (and abandon it!). And it's a shame because in my opinion it's a great work and idea.
Regards L