首页 > 技术文章 > 客户端注册 Watcher 实现?

programb 2020-07-04 13:01 原文

1、调用 getData()/getChildren()/exist()三个 API,传入 Watcher 对象
2、标记请求 request,封装 Watcher 到 WatchRegistration
3、封装成 Packet 对象,发服务端发送 request
4、收到服务端响应后,将 Watcher 注册到 ZKWatcherManager 中进行管理
5、请求返回,完成注册。

推荐阅读