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
[1/5] cluster: implement proper builder pattern & minor refactor #669
Conversation
9e3acae
to
1d04be5
Compare
This is much better! A few more minor changes. Please add a separate commit that bumps the MSRV to 1.59. |
1d04be5
to
41cd862
Compare
MSRV change is entirely unrelated to this PR. I've created a separate PR: #673 |
41cd862
to
72d5ee5
Compare
- move build method to builder - move open methods to the bottom
- implement proper builder pattern by adding `new` & `builder` methods to ClusterClient and `new` & `build` methods to ClusterClientBuilder - deprecate & redirect `open` methods for ClusterClient & ClusterClientBuilder
- this is to simplify passing multiple params to & inside ClusterConnection impl
72d5ee5
to
92c30e6
Compare
92c30e6
to
f3fd7d2
Compare
Okay, so please rebase and self-review part 2 to have small commits and align with the other feedback I've given so far, this has taken a lot of time. |
Sure, waiting for you to merge this. |
Most of the crates in the Rust ecosystem use
builder()
&build()
for client & builder as well asnew()
for both of them. Currently, the redis crate uses the unintuitiveopen()
methods for the same.With this PR, I've changed the cluster client to follow the proper builder pattern and redirect the old methods to the new ones.
Also refactored the cluster client in 2 main ways:
build()
method from the client to the builder & made it publicClusterParams
to hold all the params inside a single struct instead of multiple fields in the main structIn addition, improved the documentation as I saw fit.