Use builder pattern to construct WebRtcSocket#158
Conversation
WebRtcSocket
nuzzles
left a comment
There was a problem hiding this comment.
Please add WebRtcSocket::builder() -> WebRtcSocketBuilder
Good idea! Have used the same arguments as |
|
Look good now :) I only had a doc nit and a question. |
Co-authored-by: Johan Klokkhammer Helsing <johanhelsing@gmail.com>
|
Oh, I'd still like some dead-simple convenience methods that doesn't involve creating a builder. let socket = WebRtcSocket::new_unreliable("wss://example.com");As opposed to: let socket = WebRtcSocket::builder("wss://example.com")
.add_unreliable_channel()
.build();Internally, it would just call the builder. I want to keep simple/common usage really simple as far as possible. |
Done! Do you think we should use these or the builder in the examples? |
Hmmm.. I think it would be good to have at least one example that shows how to set up multiple channels, but in our current examples i think the simple versions are probably better. |
That seems reasonable to me, a mutli-channel example would definitely be good to have |
Ok, I think it clicked for me when you said "that's what the browser wants anyways". Fair point. |
johanhelsing
left a comment
There was a problem hiding this comment.
Alright, let's get the money! 🎉
Had a go at creating a builder for the
WebRtcSocketto replaceWebRtcSocketConfig, this should make things a touch easier when it comes to constructing sockets with numerous channels.Also added a helper to the ggrs feature to allow users to more easily add an appropriate channel.