-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Introduce JedisBroadcast to broadcast commands #3194
Conversation
Codecov ReportBase: 67.10% // Head: 66.98% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3194 +/- ##
============================================
- Coverage 67.10% 66.98% -0.12%
- Complexity 4582 4600 +18
============================================
Files 248 251 +3
Lines 14751 14846 +95
Branches 917 920 +3
============================================
+ Hits 9898 9944 +46
- Misses 4459 4504 +45
- Partials 394 398 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
I prefer not to introduce JedisBroadcast
, but directly modify the default behavior of commands such as cluster.scriptLoad
and cluster.ftCreate
(because the previous behavior is actually wrong, so we don't need to keep it).
Adding JedisBroadcast
certainly won't cause a bug, but I think Jedis should keep it simple and quiet to fix the behavior.
@yangbodong22011 Are you okay with other things? I.e. changes in ConnectionProvider interface and implementations, method signatures, etc? |
That's OK, but I tend to avoid having |
@yangbodong22011 why? |
instead of BroadcastResponse
|
I think that in the interest of consistency and quality, we should do this. If anything, a docstring can always be added in order to help users out. |
Continuing the
Continuing the @yangbodong22011 idea. @sazzad16 Why not override commands and make them broadcasted under the hood in the |
@sazzad16 I like the plug-in approach in this PR and don't like the new Could you explain why we can't add broadcast commands to the |
@uglide We can, but then... We would miss these methods from other classes (UnifiedJedis, JedisPooled, JedisSharding). Let's discuss only with JedisPooled. We can add these methods in JedisPooled separately but then concerned methods cannot be (easily) switched between Redis standalone mode and Redis cluster mode. This was long ask from users which we just added in Jedis 4.0.0 and I am trying to keep common base between JedisCluster and JedisPooled. |
@sazzad16 Thanks for explaining the context. This PR suits user needs better because it offers a "plug-in" approach, just like @yangbodong22011 mentioned in the comment above. If there are no objections, we should proceed with this PR and add more "broadcasted" commands. |
Please review. |
The current code and design look fine to me. We have a few more commands worth adding to
@sazzad16 It's up to you to decide if you want to add it or it will be added later by another contributor(when they need), I agree with both. |
No description provided.