Rust multi-threaded model access #9648
Unanswered
DavidVentura
asked this question in
General
Replies: 1 comment
-
|
a channel is unessecary imo, just carry over a weak ui state with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am making an app that needs to perform some blocking operations, and update some models with the result. What's the recommended way to do so?
A minimal example:
Right now, there's a button hooked to
on_download_language, so the UI only sends an event on a channelthe receiver is on another thread, but models aren't
Sendso my workaround is to invoke a callback on the UI:and then the UI thread has access to the models:
the
language_downloadedevent is "synthetic" -- it's only acting as a channel for me to expose models to other threads.Is there a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions