示例#1
0
    def message_handler(self, response: 'Response'):
        msg_type: MessageType = getattr(response, "MSG_TYPE")

        if self._rc_status == RCStatus.NOT_READY:
            if msg_type == MessageType.READY:
                self._rc_status = RCStatus.READY
            else:
                raise ServiceNotReadyException(
                    f"Ready notification did not arrive: {response}")

        if response.is_notification():
            self.notify_handler(response)
            return

        try:
            self.put_response(response)
        except KeyError:
            Logger.warning(
                f"Unexpected response arrived.  Respond Id : {response.msg_id}"
            )
示例#2
0
 def _check_icon_service_ready(self):
     if not self._icon_service_engine.is_reward_calculator_ready():
         raise ServiceNotReadyException("Reward Calculator is not ready")