callback execution hell gives many errors at runtime #3425
Replies: 3 comments
-
Hi, I'm not associated with this project but I'm writing similar code to your example. I'm interested in the error you're running into because I want to know if I'll end up with the same problem. I did a trivial test of a recursive call and didn't run into any errors. I also peeked at the code the macro generates and didn't spot any locking or anything fancy. But I may well have missed something. Do you have an example I can run that will fail with the error you're getting? (Ideally you'd reduce it to as little code as necessary to get to the error). I'm interested in taking a look. I also searched this repository for your error messages and got no matches. Can you post the exact full error messages specific code causes? Unrelatedly |
Beta Was this translation helpful? Give feedback.
-
This doesn't really look like a I'm happy to take a look if you could provide a minimal self-contained example. |
Beta Was this translation helpful? Give feedback.
-
@daxpedda No need I've closed the project.Thanks anyway |
Beta Was this translation helpful? Give feedback.
-
Summary
I have a callback that get called from a websocket from my browser and I'm using a #[wasm_bindgen] function in an
impl
that I am calling to retrieve the result inside the Rust environmentmy js:
my rust
basically my
impl
self
is referenced into many methods and many operation get triggered asynchronously both on js and rust side.This is resulting in many errors
unreachable
oralready borrowed
orrecursive use of object
, I would say I'm kinda facing some sort of callback execution hell.So my question is how can I make sure both environments keeps running the tasks in a manner I don't trigger a function make use of an already borrowed element. How can I keep both environments in sync because all of these errors always show on runtime which make them really hard to debug?
Thanks
ps:if you need more code please tell me.
Beta Was this translation helpful? Give feedback.
All reactions