Refactors test structure

This commit is contained in:
Sergi Delgado Segura
2019-10-04 17:29:13 +01:00
parent 1e18630ce2
commit beac88a2c5
9 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
import zmq
class ZMQPublisher:
def __init__(self, topic, feed_protocol, feed_addr, feed_port):
self.topic = topic
self.context = zmq.Context()
self.socket = self.context.socket(zmq.PUB)
self.socket.bind("%s://%s:%s" % (feed_protocol, feed_addr, feed_port))
def publish_data(self, data):
self.socket.send_multipart([self.topic, data])