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; }
/// <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); }