-
Notifications
You must be signed in to change notification settings - Fork 69
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
Go: BZPOPMAX and ZMPOP #3017
base: main
Are you sure you want to change the base?
Go: BZPOPMAX and ZMPOP #3017
Conversation
821c1a1
to
e354de2
Compare
7ab8c90
to
cf4fcf2
Compare
d3a7fcb
to
ae55983
Compare
Signed-off-by: MikeMwita <[email protected]>
ae55983
to
101427f
Compare
@@ -45,6 +45,10 @@ type SortedSetCommands interface { | |||
options *options.ZMPopOptions, | |||
) (Result[KeyWithArrayOfMembersAndScores], error) | |||
|
|||
BZPopMax(keys []string, timeoutSecs float64) (Result[KeyWithMemberAndScore], error) | |||
|
|||
ZMPop(keys []string, scoreFilter ScoreFilter) (Result[KeyWithArrayOfMembersAndScores], error) |
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.
As mentioned in this comment: #3017 (comment), the count parameter needs to be added in a separate definition as it is optional.
@@ -201,6 +201,11 @@ func toCStrings(args []string) ([]C.uintptr_t, []C.ulong) { | |||
// | |||
// `"OK"` response on success. | |||
// | |||
// For example: |
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.
Remove all these added example comments in base_client.go
. We now add examples in the api/*_test.go
files.
// Example: | ||
// | ||
// zaddResult, err := client.ZAdd("mySortedSet", map[string]float64{"a": 1.0, "b": 2.0, "c": 3.0}) | ||
// res, err := client.BZPopMax([]string{"mySortedSet"}, 1.0) | ||
// fmt.Println(res.Value()) // Output: {Key: "mySortedSet", Member: "c", Score: 3.0} |
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.
Move this to api/sorted_set_commands_test.go
instead and create examples for ExampleGlideClient
and ExampleGlideClusterClient
. Feel free to look at the DEVELOPER.md
for more details about the new way to write examples
// Example: | ||
// | ||
// res, err := client.ZMPop([]string{"mySortedSet"}, api.MAX, 2) | ||
// fmt.Println(res.Value()) // Output: {Key: "mySortedSet", MembersAndScores: [{Member: "c", Score: 3.0}, {Member: "b", Score: |
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.
Move this to api/sorted_set_commands_test.go
instead and create examples for ExampleGlideClient
and ExampleGlideClusterClient
.
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.
- Need to move examples to the corresponding file(s).
- Need to add a changelog entry as of now.
Please wait for backporting all changes from release-1.3
branch. You can merge/rebase you branch after that and implement required fixes.
Issue link
This Pull Request is linked to issue: #2971
Checklist
Before submitting the PR make sure the following are checked: