LMPOP to pop elements from the first of several lists that is not empty.
<numkeys> states how many keys follow, LEFT or RIGHT chooses the end to pop from, and COUNT sets how many elements to take, defaulting to one. Keys are examined in the order given and only the first non-empty one is touched, which is exactly what a priority queue needs: list the high priority queue first and it is drained before the others are looked at.
The reply names the key that was popped from together with the elements, so a caller working with several queues knows where the work came from. When every key is empty the reply is null; use BLMPOP to wait instead.
Syntax
Arguments
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
@upstash/redis
@upstash/redis
upstash_redis
upstash_redis
This command is not supported yet in
upstash_redis.ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
go-redis
go-redis
jedis
jedis
redis-rs
redis-rs