meshlabjs icon indicating copy to clipboard operation
meshlabjs copied to clipboard

Callback for long processing tasks

Open cignoni opened this issue 9 years ago • 3 comments

We shoud add a callback for better managment of long processing task. In this way a filter that take a lot of time from time to time give back the control to the js environmnent (for task like updating a progress bar eventually) and it does not lock the browser. Currently js process that runs for more than a few secs without returning are eligible to be considered as crashed processs...

cignoni avatar Jan 29 '16 13:01 cignoni

The correct implementation would be to run the filter processing code inside a web worker http://www.w3schools.com/html/html5_webworkers.asp

cignoni avatar Feb 03 '16 23:02 cignoni

Web worker require an external js file with the code to execute. There are some workaround, like those on https://stackoverflow.com/questions/5408406/web-workers-without-a-separate-javascript-file or the library http://www.eslinstructor.net/vkthread/

GMDIT avatar Sep 02 '16 18:09 GMDIT

Probably it just needs that the emscriptem compiled code is compiled as a webworker

http://stackoverflow.com/questions/32291084/minimal-working-example-for-emscripten-webworker

cignoni avatar Sep 02 '16 20:09 cignoni