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

Support the XAUTOCLAIM command. #2095

Merged
merged 22 commits into from
Apr 19, 2022
Merged

Conversation

ttingen
Copy link
Contributor

@ttingen ttingen commented Apr 15, 2022

Added XAUTOCLAIM support as part of #2055

The XCLAIM command has two methods, StreamClaim & StreamClaimIdsOnly. Since the XAUTOCLAIM result is a bit more complex than the XCLAIM command, I opted to consolidate to a single method and single result type.

To return just the message IDs in the result, the idsOnly parameter should be set to true. The caveat here is that the StreamEntry instances will only have Id populated when idsOnly is true, the Values array will be empty. This behavior is called out in the XML docs for the method.

I wasn't sure if this is the proper "feel" you want for this command or not. Let me know if you want to break it up like StreamClaim.

Copy link
Collaborator

@NickCraver NickCraver left a comment

Choose a reason for hiding this comment

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

I tried to add the major points here which is a decent set of changes (2 methods instead of 1, to match all existing things with different return types) but since I'm away next week I was just slammed with work TODOs before out and didn't get a chance to tweak and push changes to PRs much today, sorry about that :(

src/StackExchange.Redis/ResultProcessor.cs Outdated Show resolved Hide resolved
src/StackExchange.Redis/Interfaces/IDatabase.cs Outdated Show resolved Hide resolved
src/StackExchange.Redis/ResultProcessor.cs Outdated Show resolved Hide resolved
src/StackExchange.Redis/StreamAutoClaimResult.cs Outdated Show resolved Hide resolved
@ttingen
Copy link
Contributor Author

ttingen commented Apr 16, 2022

@NickCraver just pushed an update with your suggested changes. Please let me know if there is anything else and I'll take care of it over the weekend. Thanks!

@NickCraver
Copy link
Collaborator

@NickCraver just pushed an update with your suggested changes. Please let me know if there is anything else and I'll take care of it over the weekend. Thanks!

Awesome! Eyes are super tired so I'll try and lay eyes on this fresh in the morning :)

These are subtly needed but not obvious from the previous result processors because they always processed regardless of results. Need to ensure sanity checks in tests on how we handle a key that isn't there as well.
Copy link
Collaborator

@NickCraver NickCraver left a comment

Choose a reason for hiding this comment

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

@ttingen I think this is looking great - I made some tweaks based on aggregate PRs I'm seeing (wanna batch many classes up in the Results\ folder, etc.) but this was already great and I appreciate the thorough test suite added <3

@mgravell @slorello89 @Avital-Fine Could one of you please lay eyes on this as well since I'm touched and committed?

NickCraver added a commit that referenced this pull request Apr 16, 2022
Matching this to #2095 and I'll move others here separately.
@ttingen
Copy link
Contributor Author

ttingen commented Apr 16, 2022

@NickCraver thanks, it's been fun to get back into this. Just going through your updates so I can mirror those practices in future PRs.

@NickCraver
Copy link
Collaborator

@ttingen Definitely take some of them as stylistic and none as an issue, getting a feel for how I'd like a few things to shift as we go through a large influx of code here and it's a bit in flux and far from perfect. Your bits here were awesome, anything I can read through, understand, and tweak if wanted in 20 minutes is fantastic :)

NickCraver added a commit that referenced this pull request Apr 19, 2022
@NickCraver, working on `BITFIELD`/`BITFIELD_RO` and I realized that several of the new commands we've been adding are write-commands and therefore won't work on replicas, opening this to fix the command-map in Message.cs (pretty sure this is the right place but LMK if I'm offbase here) will need to push an update to #2095 #2094 to reflect this as well.

Co-authored-by: Nick Craver <nrcraver@gmail.com>
@NickCraver NickCraver merged commit e4a88dd into StackExchange:main Apr 19, 2022
@NickCraver
Copy link
Collaborator

@ttingen Sorry for the delay here, was trying to get some fundamentals revamped on docs and checking before merging additional commands. Thanks for all the work!

@ttingen
Copy link
Contributor Author

ttingen commented Apr 19, 2022

@NickCraver No worries. Always glad to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants