Stack(栈) = LPUSH + LPOP ->FILO Queue(队列) = LPUSH + RPOP Blocking MQ(阻塞队列) = LPUSH + BRPOP
菠萝老师关注了MacTalk,备胎说车等大V 1》 MacTalk发微博,消息ID为10018 LPUSH msg:{菠萝老师-ID} 10018 2》备胎说车发微博,消息ID为10086 LPUSH msg:{菠萝老师-ID} 10086 3》查看最新微博消息 LRANGE msg:{菠萝老师-ID} 0 5
情景如图:
127.0.0.1:6379> lpush msg:boluo1230 10018 (integer) 1 127.0.0.1:6379> lpush msg:boluo1230 10086 (integer) 2 127.0.0.1:6379> lrange msg:boluo1230 0 5 # 1) "10086" 2) "10018"
原文:https://www.cnblogs.com/boluopabo/p/12845611.html