Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Created May 26, 2012 03: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 kballenegger/312bb21c181b9b962bf6 to your computer and use it in GitHub Desktop.
Save kballenegger/312bb21c181b9b962bf6 to your computer and use it in GitHub Desktop.
require 'zmq'
require 'mongo'
require 'json'
sub = ZMQ::Context.new(1).socket(ZMQ::SUB)
sub.connect('tcp://127.0.0.1:13001')
sub.setsockopt(ZMQ::SUBSCRIBE, '')
db = Mongo::Connection.new('ip-10-205-5-172.ec2.internal').db('chartboost')
while payload = sub.recv
puts payload
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment