Skip to content

Instantly share code, notes, and snippets.

@zlei1
Created April 1, 2019 08:38
Show Gist options
  • Save zlei1/67f4408069cf9684b37251f2ae8aedf9 to your computer and use it in GitHub Desktop.
Save zlei1/67f4408069cf9684b37251f2ae8aedf9 to your computer and use it in GitHub Desktop.
require 'redis'
redis_connection = Redis.new(url: "redis://localhost:6379/0")
redis_connection.subscribe("messages") do |on|
on.message do |channel, msg|
puts "##{channel} - [#{msg}]"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment