-
Notifications
You must be signed in to change notification settings - Fork 13
Custom function and script responses #216
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
Signed-off-by: Adam Fowler <[email protected]>
✅ 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: Adam Fowler <[email protected]>
Signed-off-by: Adam Fowler <[email protected]>
Signed-off-by: Adam Fowler <[email protected]>
Add testCommandEncodesDecodes helper function Signed-off-by: Adam Fowler <[email protected]>
Signed-off-by: Adam Fowler <[email protected]>
Signed-off-by: Adam Fowler <[email protected]>
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.
public func functionLoad<FunctionCode: RESPStringRenderable>( | ||
replace: Bool = false, | ||
functionCode: FunctionCode | ||
) async throws -> FUNCTION.LOADResponse { |
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.
To ensure consistency in readability, should we call it FUNCTION.LOAD.Response
?
And Similarly for SCRIPT based methods below. Instead of returning SCRIPT.EXISTSResponse
, should we return SCRIPT.EXISTS.Response
?
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.
The reason I do this is to avoid the generic parameter that comes with FUNCTION.LOAD
. If I returned a type that was internal to FUNCTION.LOAD
it would require the generic parameter ie FUNCTION.LOAD<FunctionCode>.RESPONSE
. Given the response doesn't use the generic parameter FunctionCode
it doesn't make sense it include it.
Signed-off-by: Adam Fowler <[email protected]>
Code generator will attempt to choose the correct return value for a Valkey command, but it can only do simple types like String, Int, Array of RESP Tokens. If we want to provide more complex responses we have to write some custom code. To do this
Response
typealias in the ValkeyCommand typeAlso in this PR
testCommandEncodesDecodes
and use in script and server commands, will extend to others in separate PR