Documentation ¶
Index ¶
- Constants
- func HandleClientRestart(r ZkClientFacade)
- func ValidateZookeeperClient(container ZkClientFacade, zkName string) error
- type ZkClientFacade
- type ZkEventListener
- func (l *ZkEventListener) Close()
- func (l *ZkEventListener) ListenConfigurationEvent(zkPath string, listener remoting.DataListener)
- func (l *ZkEventListener) ListenServiceEvent(conf *common.URL, zkPath string, listener remoting.DataListener)
- func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener remoting.DataListener)
Constants ¶
View Source
const ( ConnDelay = 3 // connection delay interval MaxFailTimes = 3 // max fail times )
Variables ¶
This section is empty.
Functions ¶
func HandleClientRestart ¶
func HandleClientRestart(r ZkClientFacade)
HandleClientRestart keeps the connection between client and server This method should be used only once. You can use handleClientRestart() in package registry.
func ValidateZookeeperClient ¶
func ValidateZookeeperClient(container ZkClientFacade, zkName string) error
ValidateZookeeperClient validates client and sets options
Types ¶
type ZkClientFacade ¶
type ZkClientFacade interface { ZkClient() *gxzookeeper.ZookeeperClient SetZkClient(*gxzookeeper.ZookeeperClient) ZkClientLock() *sync.Mutex WaitGroup() *sync.WaitGroup // for wait group control, zk client listener & zk client container Done() chan struct{} // for registry destroy RestartCallBack() bool GetURL() *common.URL }
type ZkEventListener ¶
type ZkEventListener struct { Client *gxzookeeper.ZookeeperClient // contains filtered or unexported fields }
nolint
func NewZkEventListener ¶
func NewZkEventListener(client *gxzookeeper.ZookeeperClient) *ZkEventListener
NewZkEventListener returns a EventListener instance
func (*ZkEventListener) ListenConfigurationEvent ¶
func (l *ZkEventListener) ListenConfigurationEvent(zkPath string, listener remoting.DataListener)
ListenConfigurationEvent listen a path node event
func (*ZkEventListener) ListenServiceEvent ¶
func (l *ZkEventListener) ListenServiceEvent(conf *common.URL, zkPath string, listener remoting.DataListener)
ListenServiceEvent is invoked by ZkConsumerRegistry::Register/ZkConsumerRegistry::get/ZkConsumerRegistry::getListener registry.go:Listen -> listenServiceEvent -> listenDirEvent -> listenServiceNodeEvent registry.go:Listen -> listenServiceEvent -> listenServiceNodeEvent
func (*ZkEventListener) ListenServiceNodeEvent ¶
func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener remoting.DataListener)
ListenServiceNodeEvent listen a path node event
Click to show internal directories.
Click to hide internal directories.