When executing a long-running function (including Module.callMain
), is there a way to abort execution from JavaScript?
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.