Created
September 27, 2014 08:50
-
-
Save ixaxaar/2dcdc0e6e02e07bc7dd1 to your computer and use it in GitHub Desktop.
Simple zeromq push server
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
#!/usr/bin/env python | |
import time | |
import zmq | |
def server(): | |
context = zmq.Context() | |
socket = context.socket(zmq.PUSH) | |
socket.setsockopt(zmq.LINGER,0) | |
socket.connect('tcp://127.0.0.1:8880') | |
ctr = 0 | |
while 1: | |
ctr = ctr + 1 | |
if ctr % 10000 == 0: print ctr | |
socket.send(str(ctr)) | |
# time.sleep(0.00001) | |
if __name__ == "__main__": | |
server() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment