Created
June 25, 2011 21:49
-
-
Save saghul/1046938 to your computer and use it in GitHub Desktop.
ZeroMQ consumer example
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
# consumer | |
import zmq | |
context = zmq.Context() | |
socket = context.socket(zmq.SUB) | |
socket.bind('tcp://127.0.0.1:5000') | |
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