Gateway.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ChronosES 作者: belvedere-trading 项目源码 文件源码
def __init__(self, aggregateClass, **kwargs): #pylint: disable=W0613
        super(DefaultCoreProvider, self).__init__(aggregateClass)
        self.aggregateName = self.aggregateClass.__name__
        postgresUser, postgresPassword, postgresDatabase, postgresHost, postgresPort = GetPostgresConnectionDetails(self.infrastructureProvider)
        redisHost, redisPort, redisConfig = GetRedisConnectionDetails(self.infrastructureProvider)

        try:
            self.redisConnection = StrictRedis(host=redisHost, port=redisPort, **redisConfig)
        except Exception:
            EventLogger.LogExceptionAuto(self, 'Failed to initialize Notifier')
            raise
        self._notifier = self.infrastructureProvider.GetConfigurablePlugin(ConfigurablePlugin.Notifier, aggregateClass=self.aggregateClass, #pylint: disable=C0103
                                                                           redisConnection=self.redisConnection)

        self.logicConnection = PostgresLogicConnection(postgresUser, postgresPassword, postgresDatabase, postgresHost, postgresPort)
        self._logicStore = self.infrastructureProvider.GetConfigurablePlugin(ConfigurablePlugin.LogicStore, postgresConnection=self.logicConnection) #pylint: disable=C0103

        self.eventPersisterConnection = PostgresEventWriteConnection(self.aggregateName, postgresUser, postgresPassword, postgresDatabase, postgresHost, postgresPort)
        self._eventPersister = self.infrastructureProvider.GetConfigurablePlugin(ConfigurablePlugin.EventPersister, aggregateClass=self.aggregateClass, #pylint: disable=C0103
                                                                                 notifier=self._notifier, postgresConnection=self.eventPersisterConnection)

        self.eventReaderConnection = PostgresEventReadConnection(self.aggregateName, postgresUser, postgresPassword, postgresDatabase, postgresHost, postgresPort)
        self._eventReader = self.infrastructureProvider.GetConfigurablePlugin(ConfigurablePlugin.EventReader, aggregateClass=self.aggregateClass, #pylint: disable=C0103
                                                                              postgresConnection=self.eventReaderConnection)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号