Last active
August 29, 2015 14:13
-
-
Save deevis/989d6f5a34b2c25bbeb0 to your computer and use it in GitHub Desktop.
Subscribe to Redis expired key events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.subscribe("__keyevent@0__:expired") { |on| on.subscribe { |channel, subscriptions| puts "Subscribed to ##{channel} (#{subscriptions} subscriptions)" }; on.message { |channel, message| puts "Key expired: [#{message}]" }; on.unsubscribe { |channel, subscriptions| puts "Unsubscribed from ##{channel} (#{subscriptions} subscriptions)" }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment