-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use builder pattern to construct WebRtcSocket
#158
Conversation
WebRtcSocket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add WebRtcSocket::builder() -> WebRtcSocketBuilder
Good idea! Have used the same arguments as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let's get the money! 🎉
Had a go at creating a builder for the
WebRtcSocket
to 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.