Exemple #1
0
 def handle(self):
     self.data = self.recv()
     logger.debug("registering recieved: {}".format(self.data))
     self.pass_to_handler.put(self.data)
     res = RespondsePackage("ACK", "proxy registered")
     res.pack()
     self.data = res.serialize()
     self.send()
 def handle(self):
     self.data = self.recv()
     logger.info("shutdown recieved: {}".format(self.data['command']))
     res = RespondsePackage("ACK", "Shutting down {}".format(self.client_conn.address))
     res.pack()
     self.pass_to_handler.put(self.data)
     self.data = res.serialize()
     self.send()
 def _pack_response_and_send(self, res):
     self.send_to_backup()
     res = RespondsePackage(status=res.split(":")[0], body=res.split(":")[1])
     res.pack()
     if 'client' in self.data:
         res['client'] = self.data.get('client')
     self.data = res.serialize()
     self.send()
Exemple #4
0
    def handle(self):
        self.data = self.recv()
        logger.debug("heartbeat recieved: {}".format(self.data))

        #passing msg to queue
        self.pass_to_handler.put(self.data)
        res = RespondsePackage("ACK", "ACK")
        res.pack()
        self.data = res.serialize()
        self.send()