?
1.?事件通过 Redis 的订阅与发布功能(pub/sub)来进行分发,故需要订
阅?__keyevent@0__:expired 通道
0表示db0 根据自己的dbindex选择合适的数字
?
2.?修改?redis.conf?文件?
修改 notify-keyspace-events?Ex?
?
3. 重启redis , 即可测试失效事件的触发, 监听获取的值为 key
?
doc参考:?http://redis.readthedocs.org/en/latest/topic/notification.html
?
?
?
?
?
?
原文:http://jhaij.iteye.com/blog/2166093