Rust examples: Improve rooms registry logic
This change removes the redundant logic when getting or creating a room.
Thanks, I'll have to look at it carefully later
Thanks @nazar-pc
I am looking into the linting issue.
So that you know, this is just 1 of many PRs I will be creating. My main goal is to decouple the ParticipantConnection from the WebSocket connection to serve as a more generic integration template when working with non-Actix frameworks like Warp, Axum, or bare Tokio
These examples are not designed to be end-user applications even remotely, there is quite a lot more involved in production application. They are just a trivial showcase how to use the library and how to have a few more things around it. Supporting more frameworks is really not the goal here and decoupling will likely require more abstractions that will make code harder to understand, not easier.
These examples are not designed to be end-user applications even remotely, there is quite a lot more involved in production applications.
Agreed. I plan to keep existing features as is.
...and decoupling will likely require more abstractions that will make code harder to understand, not easier.
Not really. Personally, it was initially difficult to understand until I saw the boundary between the participant connection and the WebSocket connection. I think explicitly showing that boundary will simplify it a bit. I don't foresee a lot of abstractions besides a WebsocketMessageHandler trait. What do you think?
By the way, it seems the CI failure is environment-related (Something with the Rust version).
v3 branch doesn't have Cargo.lock committed (WIP flatbuffers branch does), feel free to upgrade rust-toolchain.toml to latest stable release and fix all of the clippy lints afterwards if there are any. Ideally as a separate PR.
As per above discussion, can we close this PR?
I still need to look into this, but as postponing, will try to review this week