-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add read_from_replicas method and environment variable support for Redis cluster configuration #351
Add read_from_replicas method and environment variable support for Redis cluster configuration #351
Conversation
Could you please look into the clippy error and remove the superfluous |
Is there a reason to keep the |
Thank you for your comment. The reason I implemented the read_from_replicas method was that I thought it might be easier to understand if the enabling method worked similarly to how it's done in redis-rs. However, as you pointed out, it would be better to keep things simpler by removing the method. I will proceed with that change. |
(I made the must_use change before receiving your comment, which might have caused some confusion, making it seem like I wouldn't address the read_from_replicas change. I apologize for that.) |
Could you also add this to the I was about to make a |
OK! I will also add the changes to the CHANGELOG.md, so please wait a moment. |
You changed the |
Oh no! I’m sorry! I’ve fixed it now! |
Overview
This PR introduces the following changes:
read_from_replicas
method to theConfig
struct for easier configuration.read_from_replicas
method allows enabling read operations from Redis replica nodes in a more intuitive way.REDIS_CLUSTER__READ_FROM_REPLICAS=true
environment variable for configuration.REDIS_CLUSTER__READ_FROM_REPLICAS
for enabling or disabling reading from replicas.Changes
read_from_replicas
method to simplify the process of enabling replica reads.REDIS_CLUSTER__READ_FROM_REPLICAS
.Testing
read_from_replicas
is enabled.redis-rs
, and we rely on its implementation for this verification.Issue
This PR addresses issue #350.