redis - key 过期事件

标签 redis publishing

我想知道redis中是否有一个功能可以让我获得所有过期的键(我的意思是某种事件,它让我有机会收回所有过期记录)。它的目的是将旧值保存到另一个数据库中。我听说可以使用发布机制,但谷歌无法帮助我们实现这个想法。

最佳答案

redis 的当前开发版本包含一个新功能:键空间通知。文档:http://redis.io/topics/notifications

Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way.

Examples of the events that is possible to receive are the following:

  • All the commands affecting a given key.
  • All the keys receiving an LPUSH operation.
  • All the keys expiring in the database 0.

希望它能尽快稳定下来。

顺便说一句,它在帮助您保存过期 key 的值方面不是很有用。当触发过期事件时,该值已经消失。

关于redis - key 过期事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14647494/

相关文章:

Android部署发布问题

php - 无法将 Redis 与 Codeigniter 集成

java - Spring Security 与 Redis 的并发控制

components - 发布具有Tridion ID的Tridion多媒体组件

asp.net - WebMatrix 在哪里保存站点配置?

c# - Visual Studio 在发布时移动内容文件

postgresql - 我想在 Redis 中缓存新数据,然后再将它们直接插入 Postgres

laravel - 客户端尝试使用旧密码连接到Redis

redis - Laravel Predis 更新/删除数组中的 1 个键

android - 是否可以使用正确的 key 从另一个发布帐户更新应用程序