-
Notifications
You must be signed in to change notification settings - Fork 88
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
"halted for unexpected reason awaited
" Error
#595
Comments
Hi! You have to use async variants of call / execution functions when running asynchronous code in Rune, like |
@udoprog, I was able to figure that out but I'm stuck in another way. I'm building an app with Tauri and calling the VM from a Tauri Command. I'm following this example: https://github.com/rune-rs/rune/blob/0.12.x/examples/examples/tokio_spawn.rs but I keep running into an issue with the |
Yeah, pass the |
But the error is on the I did try to spin up a new thread to get out of the Tauri runtime and run a generic tokio runtim, but I was trying to move the I'll report back! Thank you for your help. |
Note that If you keep having issues, place put together a minimal reproduction and I might be able to help. |
@udoprog, I figured out my issue. It is actually a Rust language bug where it doesn't Instead of this: let vm = Vm::new(runtime, Arc::new(unit));
let execution = vm.clone().send_execute(["main"], (5u32,))?; It should be this: let execution = {
let vm = Vm::new(runtime, Arc::new(unit));
vm.clone().send_execute(["main"], (5u32,))?;
}; So that execution.async_complete().await.unwrap(); or else there is a potential the Thank you for your help! I hope this helps someone else. |
Glad to hear it. Note that you can do without the |
Hello all,
I can't seem to figure this one out. I'm trying to write an async function following the docs for 0.12 (https://github.com/rune-rs/rune/blob/0.12.x/scripts/async.rn) and I get an error.
Function:
Error on the
vm.call()
function:Context is:
Any idea what I'm missing here?
Thanks!
The text was updated successfully, but these errors were encountered: