Background thread feeding data #633
-
Hello, I wish to know the best way to implement this. I have a thread with an infinite loop. This loop keeps fetching data continuously. The thread receives all kinds of data, and needs to dispatch it to the sub components/widgets. I see two options (maybe there's a better way):
Hoping I was clear enough. Thank you very much in advance for any help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Relm4 has several utilities for working with threads or async code that should help you: https://relm4.org/book/stable/threads_and_async/index.html In your case, I think synchronous commands are the best solution. |
Beta Was this translation helpful? Give feedback.
No, you can implement the
update_cmd
method for the component for which you need it. The basic idea is to:spawn_command
update_cmd