Skip to content

Instantly share code, notes, and snippets.

@ruedesign
Created March 22, 2013 06:49
Show Gist options
  • Save ruedesign/5219454 to your computer and use it in GitHub Desktop.
Save ruedesign/5219454 to your computer and use it in GitHub Desktop.
ZeroMQ Publisher sample (Publish-Subscribe Model)
import zmq
import time
context = zmq.Context()
pub = context.socket(zmq.PUB)
pub.bind("tcp://127.0.0.1:5555")
c = 0
while True:
msg = "[" + str(c) + "]"
pub.send(msg)
print "send:", msg
time.sleep(1.0)
c += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment