0

Redis队列

 2 years ago
source link: https://helloteemo.github.io/2021/10/31/Redis/Redis%E5%81%9A%E9%98%9F%E5%88%97/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Redis队列

发表于 2021-10-31 更新于 2021-11-01 分类于 Redis 阅读次数: 5 本文字数: 231 阅读时长 ≈ 1 分钟

使用Redis做消息队列

使用Redis做消息队列

本文的技术方案有一些在已经工作中使用了,但是大部分技术观点未被验证过,同时本文不考虑Redis的一些技术细节,只是把观点陈述出来。本文的Redis版本基于 6.2.5 版本,有一些命令在低版本的Redis中不能运行。

先来一个开胃菜吧。目前网络上流传最广的方法。众所周知,Redis实现了一个完整的list。我们直接使用LPUSHBLPOP 就可以实现一个较为完整且功能强大的消息队列。代码如下:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK