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) ListenServiceEvent(conf *common.URL, zkPath string, listener remoting.DataListener)
- func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener remoting.DataListener)
- func (l *ZkEventListener) SetClient(client *gxzookeeper.ZookeeperClient)
Constants ¶
View Source
const ( // ConnDelay connection delay interval ConnDelay = 3 // MaxFailTimes max fail times MaxFailTimes = 3 )
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 {
// contains filtered or unexported fields
}
nolint
func NewZkEventListener ¶
func NewZkEventListener(client *gxzookeeper.ZookeeperClient) *ZkEventListener
NewZkEventListener returns a EventListener instance
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
| --------> listenServiceNodeEvent
func (*ZkEventListener) ListenServiceNodeEvent ¶
func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener remoting.DataListener)
ListenServiceNodeEvent listen a path node event
func (*ZkEventListener) SetClient ¶
func (l *ZkEventListener) SetClient(client *gxzookeeper.ZookeeperClient)
nolint
Click to show internal directories.
Click to hide internal directories.