def __init__(self, datatype): self.type = datatype self.queue = [ middleware.XMLQueue(f"/{self.type}", middleware.MiddlewareType.PRODUCER) ] if datatype == "temp": self.gen = self._temp elif datatype == "msg": self.gen = self._msg elif datatype == "weather": self.queue = [ middleware.XMLQueue(f"/{self.type}/temperature", middleware.MiddlewareType.PRODUCER), middleware.XMLQueue(f"/{self.type}/humidity", middleware.MiddlewareType.PRODUCER), middleware.XMLQueue(f"/{self.type}/pressure", middleware.MiddlewareType.PRODUCER) ] self.gen = self._weather
def __init__(self, datatype): self.type = datatype self.queue = middleware.XMLQueue(f"/{self.type}")
def __init__(self, datatype): self.type = datatype #self.queue = middleware.JSONQueue(f"/{self.type}") #self.queue = middleware.PickleQueue(f"/{self.type}") self.queue = middleware.XMLQueue(f"/{self.type}")
def __init__(self, datatype, port): self.type = datatype self.port = port self.queue = middleware.XMLQueue(f"/{self.type}", middleware.MiddlewareType.CONSUMER, port)