Beispiel #1
0
        static ApolloServicePointcpf_Supplier()
        {
            var config = new ApolloConfigBuilder()
                         .SetApolloServerUrl(new Uri("http://127.0.0.1"))
                         .SetAppIDs("test")
                         .SetEnv("UAT")
                         .Build();

            _apolloServicePool = ApolloServicePool.Create(config);

            _apolloServicePool.OnError += _apolloServicePool_OnError;
        }
Beispiel #2
0
        /// <summary>
        /// 创建单例ApolloServicePool实例
        /// </summary>
        /// <param name="apolloConfigs"></param>
        /// <returns></returns>
        public static ApolloServicePool Create(params ApolloConfig[] apolloConfigs)
        {
            if (_apolloServicePool == null)
            {
                lock (_locker)
                {
                    if (_apolloServicePool == null)
                    {
                        _apolloServicePool = new ApolloServicePool(apolloConfigs);
                    }
                }
            }

            return(_apolloServicePool);
        }