REDIS中密钥过期时如何获取回调 [英] How to get callback when key expires in REDIS

查看:276
本文介绍了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中实现,请在此处阅读 http://redis.io/topics/notifications

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

这篇关于REDIS中密钥过期时如何获取回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆