[docs]classGatewayRuntime(AsyncNewLoopRuntime,ABC):""" The Runtime from which the GatewayRuntimes need to inherit """def__init__(self,args:argparse.Namespace,cancel_event:Optional[Union['asyncio.Event','multiprocessing.Event','threading.Event']]=None,**kwargs,):# this order is intentional: The timeout is needed in _set_topology_graph(), called by superself.timeout_send=args.timeout_sendifself.timeout_send:self.timeout_send/=1e3# convert ms to secondssuper().__init__(args,cancel_event,**kwargs)def_set_topology_graph(self):# check if it should be in K8s, maybe ConnectionPoolFactory to be createdimportjsongraph_description=json.loads(self.args.graph_description)graph_conditions=json.loads(self.args.graph_conditions)deployments_disable_reduce=json.loads(self.args.deployments_disable_reduce)self._topology_graph=TopologyGraph(graph_description,graph_conditions,deployments_disable_reduce,timeout_send=self.timeout_send,)def_set_connection_pool(self):importjsondeployments_addresses=json.loads(self.args.deployments_addresses)# add the connections neededself._connection_pool=GrpcConnectionPool(logger=self.logger,compression=self.args.compression,metrics_registry=self.metrics_registry,)fordeployment_name,addressesindeployments_addresses.items():foraddressinaddresses:self._connection_pool.add_connection(deployment=deployment_name,address=address,head=True)