-
Notifications
You must be signed in to change notification settings - Fork 18
Custom responses list commands #273
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ Pull request no significant performance differences ✅ SummaryNew baseline 'pull_request' is WITHIN the 'main' baseline thresholds. Full Benchmark ComparisonComparing results between 'main' and 'pull_request'ValkeyBenchmarksClient: GET benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
Client: GET benchmark | parallel 20 | 20 concurrent connections metricsMalloc (total): results within specified thresholds, fold down for details.
Connection: GET benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
Connection: GET benchmark – NoOpTracer metricsMalloc (total): results within specified thresholds, fold down for details.
Connection: Pipeline array benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
Connection: Pipeline benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
HashSlot – {user}.whatever metricsMalloc (total): results within specified thresholds, fold down for details.
ValkeyCommandEncoder – Command with 7 words metricsMalloc (total): results within specified thresholds, fold down for details.
ValkeyCommandEncoder – Simple GET metricsMalloc (total): results within specified thresholds, fold down for details.
ValkeyCommandEncoder – Simple MGET 15 keys metricsMalloc (total): results within specified thresholds, fold down for details.
|
Signed-off-by: Nilanshu Sharma <[email protected]>
Signed-off-by: Nilanshu Sharma <[email protected]>
Signed-off-by: Nilanshu Sharma <[email protected]>
Signed-off-by: Nilanshu Sharma <[email protected]>
Signed-off-by: Nilanshu Sharma <[email protected]>
Signed-off-by: Nilanshu Sharma <[email protected]>
Signed-off-by: Nilanshu Sharma <[email protected]>
928f5a6 to
528fde1
Compare
adam-fowler
left a comment
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.
Some additional comments.
This PR does make me wonder about the sense of creating responses for every command instead of allowing some just to return a RESPToken. Note the amount of extra code you needed to add in the CommandTests test
| /// - Returns: ByteBuffer if a single element was returned, nil otherwise | ||
| public func element() throws -> ByteBuffer? { | ||
| // Handle .null as it is expected when the key doesn't exist | ||
| if token.value == .null { |
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.
Checking for null here shouldn't be needed, that has already been done because the LPOP/RPOP response is optional. Which means the function can return a non-optional value. It should be RESPBulkString instead of ByteBuffer
| /// Gets the multiple elements when count was provided | ||
| /// - Returns: Array of ByteBuffer if multiple elements were returned, nil otherwise | ||
| public func elements() throws -> [ByteBuffer]? { | ||
| try [ByteBuffer]?(token) |
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.
This doesn't need to be optional
Adding custom responses for
lpopanrpopcommands which return:nilif key doesn't existByteBuffer?if invoked withoutcountparam[ByteBuffer]?if invoked withcount