BZPOPMIN key [key ...] timeout
Time complexity: O(log(N)) with N being the number of elements in the sorted set.
ACL categories: @write, @sortedset, @fast, @blocking
BZPOPMIN is the blocking variant of the sorted set
It is the blocking version because it blocks the connection when there are no members to pop from any of the given sorted sets. A member with the lowest score is popped from first sorted set that is non-empty, with the given keys being checked in the order that they are given.
timeout argument is interpreted as a double value specifying the maximum number of seconds to block.
A timeout of zero can be used to block indefinitely.
Array reply), specifically:
nilmulti-bulk when no element could be popped and the timeout expired.
- A three-element multi-bulk with the first element being the name of the key where a member was popped, the second element is the popped member itself, and the third element is the score of the popped element.
dragonfly> DEL zset1 zset2
dragonfly> ZADD zset1 0 a 1 b 2 c
dragonfly> BZPOPMIN zset1 zset2 0