If my wasm module / component traps, is there a simple way to recover from this? Or do I need to load the component from file again, add linker items, and create a new store?
Or maybe just reinstantiate the module only?
I don't know if you have to "reboot" the component when it crashed but you can use the instantiate_pre functions to parse and prepare the module but not yet run it, the returned struct can then be instantiated many times with minimum overhead
traps aren't recoverable, no: they're fatal and leave the store in an undefined state.
As Ramon says though, you can use instantiate_pre
to make instantiation much much faster
Thanks! I went with the instantiate_pre approach and it worked great :)
Ari Seyhun has marked this topic as resolved.
Last updated: Dec 23 2024 at 13:07 UTC