Exemple #1
0
 def get(self):
     """
     Returns a JSON string with the nodes offering the deployer service
     """
     m = Marco()
     try:
         nodes = m.request_for(conf.RECEIVER_SERVICE_NAME)
         self.write(json.dumps({'nodes':[n.address for n in nodes]}))
     except MarcoTimeOutException:
         self.write_message(json.dumps({"Error": "Error in marco detection"}))
Exemple #2
0
 def open(self):
     """
     Processes a new WebSocket connection, storing it in open_ws.
     Returns the nodes offering the deployer service
     """
     open_ws.add(self)
     m = Marco()
     try:
         nodes = m.request_for(conf.RECEIVER_SERVICE_NAME)
         self.write_message(json.dumps({"Nodes":[n.address for n in nodes]}))
     except MarcoTimeOutException:
         self.write_message(json.dumps({"Error": "Error in marco detection"}))