Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 def __init__(self, datatype):
     self.type = datatype
     self.queue = middleware.XMLQueue(f"/{self.type}")
Ejemplo n.º 3
0
 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}")
Ejemplo n.º 4
0
 def __init__(self, datatype, port):
     self.type = datatype
     self.port = port
     self.queue = middleware.XMLQueue(f"/{self.type}",
                                      middleware.MiddlewareType.CONSUMER,
                                      port)