Пример #1
0
    def SendStatus(self, status: fedn.Status, context):
        # Add the status message to all subscribers of the status channel
        self._send_status(status)

        response = fedn.Response()
        response.response = "Status received."
        return response
Пример #2
0
    def SendModelValidationRequest(self, request, context):
        """ Send a model update request. """
        self._send_request(request, fedn.Channel.MODEL_VALIDATION_REQUESTS)

        response = fedn.Response()
        response.response = "CONTROLLER RECEIVED ModelValidationRequest from client {}".format(
            request.sender.name)
        return response  # TODO Fill later
Пример #3
0
 def SendModelValidation(self, request, context):
     """ Send a model update response. """
     self.control.aggregator.on_model_validation(request)
     print("ORCHESTRATOR received validation ", flush=True)
     response = fedn.Response()
     response.response = "RECEIVED ModelValidation {} from client  {}".format(
         response, response.sender.name)
     return response  # TODO Fill later
Пример #4
0
 def SendModelValidation(self, request, context):
     """ Send a model update response. """
     # self._send_request(request,fedn.Channel.MODEL_VALIDATIONS)
     self.combiner.receive_validation(request)
     print("ORCHESTRATOR received validation ", flush=True)
     response = fedn.Response()
     response.response = "RECEIVED ModelValidation {} from client  {}".format(
         response, response.sender.name)
     return response  # TODO Fill later
Пример #5
0
    def SendModelUpdate(self, request, context):
        """ Send a model update response. """
        self.combiner.receive_model_candidate(request.model_update_id)
        print("ORCHESTRATOR: Received model update", flush=True)

        response = fedn.Response()
        response.response = "RECEIVED ModelUpdate {} from client  {}".format(
            response, response.sender.name)
        return response  # TODO Fill later
Пример #6
0
 def SendHeartbeat(self, heartbeat: fedn.Heartbeat, context):
     """ RPC that lets clients send a hearbeat, notifying the server that
         the client is available. """
     self.__register_heartbeat(heartbeat.sender)
     response = fedn.Response()
     response.sender.name = heartbeat.sender.name
     response.sender.role = heartbeat.sender.role
     response.response = "Heartbeat received"
     return response