zookeeper

package
v3.0.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

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) Close

func (l *ZkEventListener) Close()

Close will let client listen exit

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL