点击或拖拽改变大小

RedisClientListRightPopLeftPushAsync 方法

命令 RPOPLPUSH 在一个原子时间内,执行以下两个动作:
1. 将列表 source 中的最后一个元素( 尾元素)弹出,并返回给客户端。
2. 将 source 弹出的元素插入到列表 destination ,作为 destination 列表的的头元素。

举个例子,你有两个列表 source 和 destination , source 列表有元素 a, b, c , destination 列表有元素 x, y, z ,执行 RPOPLPUSH source destination 之后, source 列表包含元素 a, b , destination 列表包含元素 c, x, y, z ,并且元素 c 会被返回给客户端。 如果 source 不存在,值 nil 被返回,并且不执行其他动作。 如果 source 和 destination 相同,则列表中的表尾元素被移动到表头,并返回该元素,可以把这种特殊情况视作列表的旋转( rotation)操作。

命名空间:  HslCommunication.Enthernet.Redis
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public Task<OperateResult<string>> ListRightPopLeftPushAsync(
	string key1,
	string key2
)

参数

key1
类型:SystemString
第一个关键字
key2
类型:SystemString
第二个关键字

返回值

类型:TaskOperateResultString
返回的移除的对象
参见