用户工具

站点工具


server:go:etcd:callback

回调管理,处理当grpc加入或者删除时候的回调

WatchCallBackMgr

     list:map[int32][]func(string,string)
          回调map

     watchEventMutex sync.RWMutex
          map锁

     addWatchCallbacks(eventType:int32,callback:func(etcdPath:string,addr:string))
          添加回调,eventType是类型,比如:clientv3.EventTypePut或者clientv3.EventTypeDelete。callback就是具体的方法咯

     invokeWatchCallBacks(eventType int32,etcdPath:string,addr:string)
          执行回调

Instances

单例
     watchCallbackMgr:WatchCallbackMgr

server/go/etcd/callback.txt · 最后更改: 2018/09/28 09:03 由 shaishailiu