-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when passing a callback as parameter #59
Comments
Hello, That's expected. Wasm understand |
I see that it's possible with the embedded WASM in javascript (using the wasm-bindgen rust library): Also wasmer seems to support callbacks since wasmerio/wasmer#670 was closed in 2019. |
In wasmerio/wasmer#670, it's not related to passing callbacks from host to Wasm. It was related to calling Wasm functions by their index. And the index was encoded in a
|
Note, you can store your function pointer in a |
Thanks, that would be great if calling back to Java code from Wasm was possible. |
Can you describe me what you're trying to achieve please? Maybe it's possible in another way. |
I'm trying to develop a plugin system for a Spring Boot Java API. |
Wasm is a good fit for your usecase indeed! You can callback Java from Wasm with imported (host) function. It's not possible yet with |
Describe the bug
Trying to call a WASM method passing a callback parameter fails with a RuntimeException.
Steps to reproduce
The following Rust code builds the WASM code passed to Instance:
The following Java code fails when trying to call the
greet
method:Actual behavior
When run, this fails with the following exception:
Additional context
My Java version is:
The text was updated successfully, but these errors were encountered: