Skip to content

Instantly share code, notes, and snippets.

@andrewvc
Created August 17, 2010 06:48
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 andrewvc/528727 to your computer and use it in GitHub Desktop.
Save andrewvc/528727 to your computer and use it in GitHub Desktop.
DripDrop::Node.new do |node|
zpub = node.zmq_pub('tcp://127.0.0.1:2902') #Create a ZMQ Pub Socket
ws = node.websocket('ws://127.0.0.1:2903') #Create a em-websocket websocket socket
#Create a ZMQ Sub socket, and handle recv of DripDrop::Message messages
node.zmq_sub('tcp://127.0.0.1:2904') do |message|
message.body = message.decoded.body.upcase
zpub.send_message(message) websocket.send_message(message)
end
end
#... other nodes go here
DripDrop::NodePool.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment