-
Notifications
You must be signed in to change notification settings - Fork 694
Open
Labels
Description
Compilation (and instantiation?) of WebAssembly module could be a resource intensive operation so there should be a way for wasm hosts to abort this step in cases when module is not needed anymore for some reasons.
As for JS hosts, theoretically cancellation methods should be in JS API, but JS doesn't have cancellation mechanism for promises yet. There are AbortController and AbortSignal which are used to abort Fetch. Probably they can be used to abort wasm compilation (passing signal as extra parameter to WebAssembly.compile
), but they are part of DOM WHATWG spec, so it's only possible to use them in browsers and as a consequence only in Web API.