REDIS中密钥过期时如何获取回调

编程入门 行业动态 更新时间:2024-10-24 16:30:11
本文介绍了REDIS中密钥过期时如何获取回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Bottle开发应用程序.在我的注册表中,我要通过邮件确认带有唯一密钥的电子邮件.我将此密钥存储在REDIS中,有效期为4天.如果用户未在4天内确认电子邮件,则密钥将过期.为此,我想从数据库(mongoDB)中永久删除用户条目.

I'm developing application using Bottle. In my registration form, I'm confirming email by mail with a unique key. I'm storing this key in REDIS with expiry of 4 days. If user does not confirm email within 4 days, key gets expired. for this, I want to permanently delete the user entry from my database(mongoDB).

当然,我不需要对我的Redis服务器进行连续轮询来检查密钥是否存在.

Ofcourse I dont require continous polling to my redis server to check whether key exists or not.

有什么方法可以从Redis中获取回调吗?

Is there any way to get a callback from Redis??

或者还有其他有效的方法吗?

OR is there any other efficient way?

推荐答案

此功能在Redis 2.8中实现,请在此处阅读 redis.io/topics/notifications

This feature implemented in Redis 2.8, read about it here redis.io/topics/notifications

更多推荐

REDIS中密钥过期时如何获取回调

本文发布于:2023-11-17 08:15:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609431.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密钥   回调   REDIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!