Created
October 8, 2010 15:24
-
-
Save andrewvc/616962 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
#New Style: | |
DripDrop::Node.new | |
addr = 'tcp://127.0.0.1:2222'; | |
zmq_sub(addr,:bind) do |message| | |
end | |
pub = zmq_pub(addr,:connect) | |
pub.send_message(:name => 'test', :body => 'hi') | |
end.start! | |
#Much better than the old style (which should still work)... | |
DripDrop::Node.new do |node| | |
addr = 'tcp://127.0.0.1:2222'; | |
node.zmq_sub(addr,:bind) do |message| | |
end | |
node.pub = zmq_pub(addr,:connect) | |
pub.send_message(DripDrop::Message.new('test', :body => 'hi')) | |
end.start! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment