Skip to content
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

feat(redis): add NewWithClient to work with pre-existing client #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glimchb
Copy link
Contributor

@glimchb glimchb commented Oct 25, 2023

Signed-off-by: Boris Glimcher Boris.Glimcher@emc.com

@glimchb glimchb force-pushed the redis-new-client branch 2 times, most recently from 1d7f2d5 to 3423387 Compare October 25, 2023 21:00
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2023

Codecov Report

Merging #137 (20b72c5) into master (99127de) will increase coverage by 0.23%.
Report is 15 commits behind head on master.
The diff coverage is 0.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
+ Coverage   64.60%   64.84%   +0.23%     
==========================================
  Files          24       25       +1     
  Lines        2057     2085      +28     
==========================================
+ Hits         1329     1352      +23     
- Misses        601      606       +5     
  Partials      127      127              
Files Coverage Δ
redis/redis.go 70.49% <0.00%> (-6.30%) ⬇️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Owner

@philippgille philippgille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking forward to these constructors to give users maximum flexibility while keeping our library surface area small 👍

Just two comments. And if #130 is merged first, a change to the Godoc here might be required to mention the timeout option (in addition to the codec, as applicable options)

redis/redis.go Show resolved Hide resolved
if options.Codec == nil {
options.Codec = DefaultOptions.Codec
}
return &Client{c: rc, codec: options.Codec}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NewClient currently includes a Ping call to check/establish a connection. Maybe we can do the same here, to minimize NewClient vs NewWithClient differences?

@philippgille
Copy link
Owner

Ah and P.S.: I think we should also extend the tests to make use of a client created with this new constructor

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants