Created
September 21, 2017 08:40
-
-
Save tadassce/4f7520887f0650e99c7107da858de910 to your computer and use it in GitHub Desktop.
Subscribe to Redis HSET 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
require 'redis' | |
redis = Redis.new | |
redis.config(:set, 'notify-keyspace-events', 'Eh') | |
redis.psubscribe('__keyevent@*__:hset') do |on| | |
on.pmessage do |_pattern, _channel, hash_key| | |
puts "Hash #{hash_key} has been updated." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment