Пример #1
0
func ListenToZooKeeper(config c.Zookeeper, deb bool) (chan zk.Event, chan bool) {
	c, _, err := zk.Connect(config.ConnectionString(), time.Second)

	if err != nil {
		panic(err)
	}

	return ListenToConn(c, config.Path, deb, config.Delay())
}
Пример #2
0
func createAndListen(conf configuration.Zookeeper) (chan zk.Event, *zk.Conn) {
	conn, _, err := zk.Connect(conf.ConnectionString(), time.Second*10)

	if err != nil {
		log.Panic(err)
	}

	ch, _ := qzk.ListenToConn(conn, conf.Path, true, conf.Delay())
	return ch, conn
}