Skip to content

Instantly share code, notes, and snippets.

@davidx
Created January 12, 2010 09:49
Show Gist options
  • Save davidx/275063 to your computer and use it in GitHub Desktop.
Save davidx/275063 to your computer and use it in GitHub Desktop.
client:
require 'rubygems'
require 'mq'
redis_command = ["INFO"].join("\r\n")
EM.run do
mq = MQ.new
q = mq.queue('vanity')
q.publish(redis_command)
end
flush_queue_to_redis.rb
require 'rubygems'
require 'mq'
require 'redis'
settings = { :host => 'localhost',
:port => 6379,
:db => 1 }
EM.run do
mq = MQ.new
q = mq.queue('vanity')
q.subscribe do |msg|
p "command:" + msg
@redis = Redis.new(settings)
@redis.connect_to_server
p @redis.call_command([msg])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment