-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adds support for SMEMBERS.WATCH command #1289
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for adding support for SMEMBERS.WATCH
command @superiorsd10! Had a few small comments.
internal/eval/store_eval.go
Outdated
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.
Could you reformat this file? I'm seeing additional diffs here due to indentation changes which makes it harder to see the actual code changes.
}) | ||
} | ||
|
||
func sortSlice(v any) any { |
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.
Do we really need to use sortSlice? I think we may be able to use testify library's assert.ElementsMatch
method
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.
Requested changes.
Hi @superiorsd10 , Please rebase the PR with latest master, Thanks. |
a42d0e1
to
cc9989e
Compare
@apoorvyadav1111 I've rebased it with the latest master. Thank you! |
This PR implements the feature described in the issue #1132. The new
SMEMBERS.WATCH
command allows subscribed clients to receive push responses whenever the data in a respective set is modified.Changed Introduced
evalSADD
functionSMEMBERS.WATCH
Why did I modified the
evalSADD
functionI have had to modify this function because the subscribers were receiving double notifications for the first
SADD
command. The old implementation caused double notifications because it performed astore.PUT
for the initial set creation and subsequent additions. The new implementation defers thestore.PUT
operation until all additions are complete, ensuring subscribers are notified only once.Why Sorting the Results in Integration Tests Is Necessary
To validate the correctness of the reactive system, we care about the contents and not the order of the set. Sorting both the expected and received results allows us to
Screenshot