Created
July 30, 2018 07:38
-
-
Save brynmathias/a5e1132e5706f0ba9f93e97d08c1e776 to your computer and use it in GitHub Desktop.
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 python3 | |
from MessageCorps.broker import kafka_producer | |
from protobuf.data.ImageData_pb2 import Image | |
from time import sleep | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
def main(): | |
producer = kafka_producer(bootstrap_servers=['localhost:9092'], topic="VideoStream") | |
test_image = Image( | |
image_data = b"this is just a test string", | |
height = 10, | |
width = 10 | |
) | |
for frame in range(100): | |
test_image.frame = frame | |
producer.send(test_image) | |
sleep(1) | |
if __name__ == "__main__": |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment