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
I'm currently working on an application, where I have a worker thread next to the main thread, which fetches content from an API and then should update the "backend data" and also the UI.
I've looked a bit at some examples and e.g. the todo_mvc example implements the Model trait on a struct to store the data to show in the UI.
Now I tried adapting this for testing purposes, but I can't get around the problem, that the ModelNotify can't be shared accross threads.
This is a problem, because I want to use functions from the Controller struct (like in todo mvc) to update the model from the worker thread, so my first Idea was to put the controller into an Arc, but that does not work with ModelNotify from what I can see.
Does anyone have and ideas or insights with this or similar problems?
I'm still relatively new to Rust and Slint and am trying to figure out a usable architecture for the application I'm developing.
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.
-
I'm currently working on an application, where I have a worker thread next to the main thread, which fetches content from an API and then should update the "backend data" and also the UI.
I've looked a bit at some examples and e.g. the todo_mvc example implements the
Model
trait on a struct to store the data to show in the UI.Now I tried adapting this for testing purposes, but I can't get around the problem, that the
ModelNotify
can't be shared accross threads.This is a problem, because I want to use functions from the Controller struct (like in todo mvc) to update the model from the worker thread, so my first Idea was to put the controller into an Arc, but that does not work with
ModelNotify
from what I can see.Does anyone have and ideas or insights with this or similar problems?
I'm still relatively new to Rust and Slint and am trying to figure out a usable architecture for the application I'm developing.
Beta Was this translation helpful? Give feedback.
All reactions