Websocket inside rust to update state #501
Replies: 4 comments
-
Hi, using websocket crates should work nicely with Rinf, in async Rust code. As introduced in the Rinf docs(link), if you choose to use the actor model, and pass messages received from the websocket to an actor, storing the latest data you received from the websocket is possible. Or you can directly pass Protobuf messages converted from websocket messages to Flutter widgets, too. I personally recommend using Unfortunately there isn't any example for this in the current repository right now. |
Beta Was this translation helpful? Give feedback.
-
I am actually thinking about shifiting from My usecase is not performance critical but time critical. So, do you recommend shifting to it?? Will the protbuf be an issue in this case?? |
Beta Was this translation helpful? Give feedback.
-
Since you're sending tens of messages per second, Protobuf won't be an issue. Protobuf is know to be very efficient. As you said, since Rinf makes you write the logic in pure Rust, complex business logic can run efficiently in an async runtime like I haven't used |
Beta Was this translation helpful? Give feedback.
-
@temeddix I am having certain issues due to my aquantaince with iced. Do you have any app that have multiple messages and a central state to manage? The example seems very lacking. I am using I also don't know if I should send the whole state as update to the UI or a certain part of it. |
Beta Was this translation helpful? Give feedback.
-
Is there any example showing the usage of websocket in rust that constantly update the UI. The websocket is expected to receive about 10 msgs per sec. Will that cause an issue with the structure??
Beta Was this translation helpful? Give feedback.
All reactions