zookeeper

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

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

func (l *ZkEventListener) Close()

Close will let client listen exit

func (*ZkEventListener) ListenConfigurationEvent added in v3.0.1

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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