javascriptwebassemblyemscripten

Emscripten - Is there a way to abort execution from JavaScript?


When executing a long-running function (including Module.callMain), is there a way to abort execution from JavaScript?


Solution

  • The only way is to run the WebAssembly in a worker thread and terminate the entire thread from the main thread. You cannot terminate an individual WebAssembly function.