午休时间把nacos1.1.4源码下下来了然后开始看源码
每天真实记录
Demo里面 NamingExample里面开始看起
NacosNamingService
//初始化各种配置
namespace = InitUtils.initNamespaceForNaming(properties);
initServerAddr(properties);
InitUtils.initWebRootContext();
initCacheDir();
initLogName(properties);
//新建了一个线程池 线程池会每隔五分钟从队列里面拉取 serviceInfo(目前看serviceInfo应该是注册表)
eventDispatcher =new EventDispatcher();
serverProxy =new NamingProxy(namespace, endpoint, serverList);
serverProxy.setProperties(properties);
//发送心跳线程池
beatReactor =new BeatReactor(serverProxy, initClientBeatThreadCount(properties));
//
hostReactor =new HostReactor(eventDispatcher, serverProxy, cacheDir, isLoadCacheAtStart(properties), initPollingThreadCount(properties));