Created
August 17, 2010 06:48
-
-
Save andrewvc/528727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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