-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
LPOS feature #2080
LPOS feature #2080
Conversation
Appveyor doesn't care for me 😆 |
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.
Added comments on code so far (looking good, mostly formatting) - will check out tests in the AM with fresh eyes :)
Co-authored-by: Nick Craver <nrcraver@gmail.com>
@NickCraver - FYI I needed to add another ResultProcessor for handling a default value type since the Also, this line is redundant, maybe it should be nixed? |
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 think this is looking good - added a few more thoughts, mainly around:
- Using regions like a heathen!
- ...and restricting the result processor more to the specific nil case :)
public Task<long> ListPositionAsync(RedisKey key, RedisValue element, long rank = 1, long maxLength = 0, CommandFlags flags = CommandFlags.None) | ||
{ | ||
var msg = CreateListPositionMessage(Database, flags, key, element, rank, maxLength); | ||
return ExecuteAsync(msg, ResultProcessor.Int64DefaultNegativeOne); |
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.
Same on default
@slorello89 Yep I gotcha - added thoughts on there, and yeah we can nuke that line - feel free to throw in there since it'll be gone from history and is discussed here. |
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.
Your fantastic region-free artisanal code is looking awesome, thanks for this!
@slorello89 Just adding release notes - will merge once builds are good :) |
Isn't a lack of preprocessor directives one of the pillars of "clean code"? 😆 |
Implements the LPOS command for #2055
Had to add a new Message type to accommodate.
@NickCraver, one thing that might be slightly controversial, I set
rank
to 1 andmaxlen
to 0 by default, this is operationally equivalent to not adding them at all but very much simplifies the message creation without having to do any other array/list allocations. LMK what you think of this.Also is there a better way to extract an array of expected Value-types? maybe a new ResultsProcessor?