Redis 的 blpop 命令给出多个 key 有什么作用

背景

学习 Redis 时 Redis 给出的 BLPOP 命令的格式为 BLPOP key [key ...] timeout,以为是从多个 key 中都弹出一个,但是自己测试下来不是这样。

学习

简单搜索了一下,没发现有讲这多个 key 的。

看了官方文档,如下

An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.

即从第一个非空的 key 中弹出头部的元素。

实操

创建多个列表

posted @ 2025-05-19 21:53  yu__xuan  阅读(15)  评论(0)    收藏  举报