Skip to content

Instantly share code, notes, and snippets.

@katpadi
Last active January 12, 2017 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katpadi/2eca03737eb188707cc79e9969185eee to your computer and use it in GitHub Desktop.
Save katpadi/2eca03737eb188707cc79e9969185eee to your computer and use it in GitHub Desktop.
redis-kesypace-event
# Set it up.
$redis.config(:set, 'notify-keyspace-events', 'zE')
# Subscriber
$redis.psubscribe('__keyevent@*__:zrem') do |on|
on.pmessage do |pattern, channel, message|
puts "==== AFTER zrem EVENT ====="
# Available things:
puts "pattern: #{pattern}"
puts "channel: #{channel}"
puts "message: #{message}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment