Skip to content

Instantly share code, notes, and snippets.

Created Jun 25, 2011
What would you like to do?
ZeroMQ consumer example
# consumer
import zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.setsockopt(zmq.SUBSCRIBE, 'test')
socket.setsockopt(zmq.SUBSCRIBE, 'topic_1')
while True:
data = socket.recv()
print data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment