-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
Hi folks, I'm writing a solution to run WASM files using wasmtime, I use WIT to define a handler function which I'm expecting to call from my solution (host) through using wasmtime.
I have the following WIT definitions from the binary WASM file I've builded:
// ...
package wasi:random@0.2.6 {
interface insecure-seed {
insecure-seed: func() -> tuple<u64, u64>;
}
}
package mate:runtime@0.1.0 {
interface api {
handler: async func(data: string) -> result<string, string>;
}
}The following code attempts to use the wasm_module, retrieves the function using get_typed_func::<(String,), (Result<String, String>,)> and runs it.
The name used for the function is the following:
When I try to run it I get the following error:
Error: Function 'mate:[email protected]/api#handler' not found
Caused by:
failed to find function export
I have tried with different names:
- Skipping package name:
api#handler - Using function name directly:
handler
But it fails with the same error.
Thanks in advance!
Reference Code
The whole implementation lies on this branch:
https://github.com/LeoBorai/mate/tree/1-async-wasm-execution
Metadata
Metadata
Assignees
Labels
No labels