Nacos(python)

杂记

  • NacosTimer: 轮询的方式执行一个回调函数
  • Watcher: 监听的方式来同步配置
    • add_config_watcher
      • _init_pulling: 通过新开后台线程,轮询(while True)来拉取数据(队列的方式获取cache_key, content, md5 = self.notify_queue.get()),比较当前md5是否和last_md5一致,如果不一致,则通过线程池的方式来执行回调函数
      • _do_pulling: 通过后台进程,通过listener接口获取change_keys(nacos data_id),轮询拉取数据,将结果put到队列中【queue.put((cache_key, cache_data.content, cache_data.md5))】
posted @ 2023-01-12 10:23  春树&暮云  阅读(440)  评论(0编辑  收藏  举报