You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mlua it is possible to yield from an AsyncThread back to rust. I want to run multiple coroutines in parallel, demonstrated in the following example.
At the first try, this code works without any problems. However as soon as i enable the send feature on the mlua-crate it crashes with the following error (UserDataBorrowError):
called `Result::unwrap()` on an `Err` value:CallbackError{traceback:"stack traceback:\n\t[C]: in ?\n\t__mlua_async_poll:4: in function <__mlua_async_poll:1>\n\tmlua-test/src/main.rs:35:1: in function <mlua-test/src/main.rs:35:1>",cause:BadArgument{to:Some("MyUserData.wait_ms"),pos:1,name:Some("self"),cause:UserDataBorrowError}}
In this example, the yield is not necessary, however this is only for demonstration purposes.
I've read in the docs: Please note that you cannot cross Thread boundries. Is this meant by the note? Why is it than possible without the Send feature.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In mlua it is possible to yield from an
AsyncThreadback to rust. I want to run multiple coroutines in parallel, demonstrated in the following example.At the first try, this code works without any problems. However as soon as i enable the
sendfeature on themlua-crate it crashes with the following error (UserDataBorrowError):In this example, the yield is not necessary, however this is only for demonstration purposes.
I've read in the docs:
Please note that you cannot cross Thread boundries. Is this meant by the note? Why is it than possible without theSendfeature.Beta Was this translation helpful? Give feedback.
All reactions