示例#1
0
        public FailoverReactor(HostReactor hostReactor, string cacheDir)
        {
            _hostReactor = hostReactor;
            _failoverDir = Path.Combine(cacheDir, FAILOVER_PATH);

            Init();
        }
示例#2
0
        public NacosNamingService(NamingConfig config, IHttpClientFactory httpClientFactory)
        {
            _config = config;

            _eventDispatcher = new EventDispatcher();
            _namingProxy     = new NamingProxy(config, new FastHttp(httpClientFactory, config));
            _beatReactor     = new BeatReactor(_namingProxy);
            _hostReactor     = new HostReactor(_eventDispatcher, _namingProxy, config.CacheDir, config.LoadCacheAtStart);
        }
示例#3
0
        public HostReactorTest()
        {
            _config = new NamingConfig
            {
                EndPoint   = "http://localhost:8848",
                ServerAddr = new List <string>()
                {
                    "http://localhost:8848"
                },
                Namespace = "vip56"
            };
            MockData();
            var namingProxy     = MockNamingProxy();
            var eventDispatcher = new EventDispatcher();

            _hostReactor = new HostReactor(eventDispatcher, namingProxy, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "nacos"));
        }