async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) math_function_talent_1 = MathFunctions(pg_config) math_function_talent_2 = MathFunctions(pg_config) await asyncio.gather(math_function_talent_1.start(), math_function_talent_2.start())
async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) mapper = RandomMapper(pg_config) worker1 = RandomWorker(pg_config) worker2 = RandomWorker(pg_config) reducer = RandomReducer(pg_config) await asyncio.gather(mapper.start(), worker1.start(), worker2.start(), reducer.start())
async def init_protocol_gateway(self): self.protocol_gateway = ProtocolGateway( self.config['protocolGateway'], 'HalInterface-{}'.format(id(self)), True) if len(self.config['protocolGateway']['adapters']) != 1: raise Exception( 'Invalid ProtocolGateway Configuration: only one adapter is allowed!' ) # pylint: disable=anomalous-backslash-in-string self.topic_regex = re.compile('([^\.]+)\.(.+)\/(?:enable|disable)$') self.logger.info("ProtocolGateway created") await self.protocol_gateway.subscribe_json('+/enable', self.on_enable) await self.protocol_gateway.subscribe_json('+/disable', self.on_disable) self.logger.info("Subscribed for: enable/disable") return self.protocol_gateway
async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) talent = TestSetSDK(pg_config) await talent.start()
async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) function_provider = FunctionProvider(pg_config) await function_provider.start()
async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) test_runner = TestRunner(pg_config) await test_runner.start()
async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) charging_station_talent = ChargingStationTalent(pg_config) await charging_station_talent.start()
async def main(): mqtt_config = MqttProtocolAdapter.create_default_configuration() pg_config = ProtocolGateway.create_default_configuration([mqtt_config]) verify_talent = VerifyTalent(pg_config) await verify_talent.start()