cnr-isti-vclab / meshlabjs

A javascript client based mesh processing tool. Built using vcg library, emscripten and webgl
http://www.meshlabjs.net
GNU Affero General Public License v3.0
230 stars 51 forks source link

Callback for long processing tasks #72

Open cignoni opened 8 years ago

cignoni commented 8 years ago

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 commented 8 years ago

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

GMDIT commented 8 years ago

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/

cignoni commented 8 years ago

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