Replies: 2 comments 1 reply
-
Yep. I'm already working on it. Currently Basically if you want to send a message to a server, return a |
Beta Was this translation helpful? Give feedback.
-
The However, I agree it's not quite clear how to run long-lived tasks in the background and establish communication with the I have some ideas to improve the learning curve by providing additional function helpers. |
Beta Was this translation helpful? Give feedback.
-
Hi Folks,
First of all, thanks for all the hard work. I'm just getting started with Iced, but it looks incredible!
Secondly, I am building my first GUI and am trying to use iced for it. I am trying to build my own Todo MVC for all intents and purposes but with more of a server-client architecture as a personal project. I'm hoping to separate the server and UI into separate binaries at some point, but they aren't at the moment for ease of testing. I am reasonable at rust but have never worked with async before, so this is very much from a newbie's perspective.
currently, my
main
function pretty much looks like this:The iced part doesn't interact with the server yet; I'm just trying to get things up and running. It builds and runs fine. However, I have two problems:
Firstly, It is not obvious to me at all how to handle other tasks in the background from this application because the documentation about
Application::run
says:So if it will not yield control back at all, how can my other thread do its work?
Secondly, When I try to run the application, it works okay, but once the programme exits, I get the following error:
I understand that the application tries to spawn its own runtime, but it's not clear to me how to set up the thread for the server part because of this?
So my question is, could there be some more documentation/examples of properly handling async setups? Async workloads and runtimes have been a very steep learning curve for me, and I suspect I'm not the only one, so some more explicit help in this region would be much appreciated. I'd love to do some of the writing. Still, obviously, I'd need some help to understand how it all works first 😅 I know this has been mentioned in #313, but since I'm asking for documentation instead of changes, I thought a separate discussion would be useful. I hope I'm not missing anything too obvious. Thanks for all your time regardless :)
Beta Was this translation helpful? Give feedback.
All reactions