nacos 自动刷新配置

com.alibaba.nacos.client.config.impl.ClientWorker

private final BlockingQueue<Object> listenExecutebell = new ArrayBlockingQueue<>(1);

  @Override
        public void startInternal() {
            executor.schedule(() -> {
                while (!executor.isShutdown() && !executor.isTerminated()) {
                    try {
              // listenExecutebell中一直不会没有数据,暂停5秒 listenExecutebell.poll(
5L, TimeUnit.SECONDS); if (executor.isShutdown() || executor.isTerminated()) { continue; } executeConfigListen(); } catch (Throwable e) { LOGGER.error("[ rpc listen execute ] [rpc listen] exception", e); } } }, 0L, TimeUnit.MILLISECONDS); }

 


posted @ 2024-09-03 15:10  真某人  阅读(9)  评论(0编辑  收藏  举报