Python: add BZPOPMIN and BZPOPMAX commands#1399
Conversation
| Lolwut, | ||
| ArrayOfArraysOfDoubleOrNull, | ||
| ArrayOfKeyValuePairs, | ||
| KeyWithMemberAndScore, |
There was a problem hiding this comment.
How come this wasn't included in the Java implementation?
There was a problem hiding this comment.
ig it was forgotten, good catch:)
There was a problem hiding this comment.
Yeah its because the conversion is needed for RESP2 responses. The Java wrapper doesn't support RESP2 yet but Python does
| if array.len() == 3 | ||
| && matches!(array[2], Value::BulkString(_) | Value::SimpleString(_)) => | ||
| { | ||
| array[2] = |
There was a problem hiding this comment.
Does this only convert the third argument to double? Can there be more arguments with more keys where the timeout is greater than the third argument?
There was a problem hiding this comment.
redis> ZADD zset1 0 a 1 b 2 c
(integer) 3
redis> BZPOPMIN zset1 zset2 0
1) "zset1"
2) "a"
3) "0"
replay can be one of the following:
Nil reply: when no element could be popped and the timeout expired.
Array reply: the keyname, popped member, and its score.
so when its an array replay, which means we popped an element, we want to convert just the score from string to double
| Lolwut, | ||
| ArrayOfArraysOfDoubleOrNull, | ||
| ArrayOfKeyValuePairs, | ||
| KeyWithMemberAndScore, |
There was a problem hiding this comment.
ig it was forgotten, good catch:)
| if array.len() == 3 | ||
| && matches!(array[2], Value::BulkString(_) | Value::SimpleString(_)) => | ||
| { | ||
| array[2] = |
There was a problem hiding this comment.
redis> ZADD zset1 0 a 1 b 2 c
(integer) 3
redis> BZPOPMIN zset1 zset2 0
1) "zset1"
2) "a"
3) "0"
replay can be one of the following:
Nil reply: when no element could be popped and the timeout expired.
Array reply: the keyname, popped member, and its score.
so when its an array replay, which means we popped an element, we want to convert just the score from string to double
| BZPOPMAX is the blocking variant of ZPOPMAX. | ||
|
|
||
| BZPOPMAX is a client blocking command, see https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands for more details and best practices. |
There was a problem hiding this comment.
| BZPOPMAX is the blocking variant of ZPOPMAX. | |
| BZPOPMAX is a client blocking command, see https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands for more details and best practices. | |
| `BZPOPMAX` is the blocking variant of `ZPOPMAX`. | |
| `BZPOPMAX` is a client blocking command, see https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands for more details and best practices. |
There was a problem hiding this comment.
I don't think hyperlinks like these are supported by default, according to this stack overflow post they aren't, but some tools and/or documentation generators may support them. Looks like VScode does, but I'm using pycharm and it doesn't. Let me know if you still want me to change this to a hyperlink though
a67c7ba to
3f1e3c4
Compare
|
@shohamazon Thanks for the review, all comments are addressed now |
|
@aaron-congo please, resolve conflicts and merge |
9c3e15f to
6a23610
Compare
* Python: add BZPOPMIN and BZPOPMAX commands (#266) * Update PR link * PR suggestions * Fix rust
* Python: add BZPOPMIN and BZPOPMAX commands (#266) * Update PR link * PR suggestions * Fix rust


Issue #, if available:
N/A
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.