Created
August 5, 2019 09:22
-
-
Save pietern/ecddd844b4f762e3fbe188ee7bf46d01 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
from nanomsg import Socket, PUB | |
import time | |
import sys | |
pub = Socket(PUB) | |
pub.bind('tcp://127.0.0.1:5000') | |
# Publishes 1MB of data per second. | |
# Adjust as needed. | |
while True: | |
buf = sys.stdin.read(1024 * 1024) | |
pub.send(buf) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment