bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
14.81k stars 1.24k forks source link

Is it possible to abort a component function call without fueling mechanism? #8863

Closed sammyne closed 5 days ago

sammyne commented 1 week ago

Given host utils fn as

interface greeter{
  greet: func();
}

which will be implemented by Host, and called by someone else's fn hello-world.

When calling hello-world with Func::call_async, are there APIs to quit within greet's body without returning hello-world fn, but returning directly to Func::call_async.

alexcrichton commented 1 week ago

You can also use Config::epoch_interruption but those are the only two implemented methods of interrupting executing WebAssembly code. If you only need to interrupt the host, and not the guest, you can just use async without fuel/epochs.