Skip to main content

Arguments

key
str
required
The key of the stream.
group
str
required
The consumer group name.
start
str
The minimum pending ID to return (use with end and count).
end
str
The maximum pending ID to return (use with start and count).
count
int
The maximum number of pending messages to return.
consumer
str
Filter results by a specific consumer.
idle
int
Filter by minimum idle time in milliseconds.

Response

When called without range arguments, returns a summary with total count and range info. When called with range arguments, returns detailed pending message information.
result = redis.xpending("mystream", "mygroup")
[
  2,  # total pending count
  "1638360173533-0",  # smallest pending ID
  "1638360173533-1",  # greatest pending ID
  [["consumer1", "2"]]  # consumers and their pending counts
]
I