コード例 #1
0
    def _initialization(self, start_message: PusherStartMessage):
        Actor._initialization(self, start_message)
        self.database = start_message.database

        try:
            self.database.connect()
        except DBError as error:
            raise InitializationException(error.msg) from error
コード例 #2
0
    def _initialization(self, message: StartMessage):
        Actor._initialization(self, message)
        self.formula_class = message.formula_class
        self.formula_values = message.formula_values
        self.route_table = message.route_table
        self.device_id = message.device_id

        self.formula_name_service = FormulaNameService()

        if self.route_table.primary_dispatch_rule is None:
            raise InitializationException(
                'Dispatcher initialized without primary dispatch rule')
コード例 #3
0
ファイル: formula_actor.py プロジェクト: powerapi-ng/powerapi
 def _initialization(self, start_message: FormulaStartMessage):
     Actor._initialization(self, start_message)
     self.pushers = start_message.values.pushers
     self.device_id = start_message.domain_values.device_id
     self.sensor = start_message.domain_values.sensor