mediasoup icon indicating copy to clipboard operation
mediasoup copied to clipboard

Rust examples: Improve rooms registry logic

Open Jurshsmith opened this issue 2 years ago • 7 comments

This change removes the redundant logic when getting or creating a room.

Jurshsmith avatar Aug 29 '23 21:08 Jurshsmith

Thanks, I'll have to look at it carefully later

nazar-pc avatar Aug 29 '23 21:08 nazar-pc

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

Jurshsmith avatar Aug 29 '23 21:08 Jurshsmith

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.

nazar-pc avatar Aug 29 '23 21:08 nazar-pc

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).

Jurshsmith avatar Aug 29 '23 22:08 Jurshsmith

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.

nazar-pc avatar Aug 29 '23 22:08 nazar-pc

As per above discussion, can we close this PR?

ibc avatar Oct 23 '23 07:10 ibc

I still need to look into this, but as postponing, will try to review this week

nazar-pc avatar Oct 23 '23 07:10 nazar-pc