Esempio n. 1
0
func (self *SlaveManager) Exam() {
	// TODO verify
	c := time.Tick(config.HeartBeatInterval() * 3)
	for _ = range c {
		println("tick")
		go self.examSlaveAliveRoutine()
		go self.examSlaveBlockRoutine()
	}
}
Esempio n. 2
0
func (self *DataServer) examServer(done chan<- error) {
	err := self.registerDataServer()
	if err != nil {
		done <- err
		return
	}
	log.Printf("Server Registered to master")
	c := time.Tick(config.HeartBeatInterval())
	for _ = range c {
		go self.examServerRoutine()
	}
}
Esempio n. 3
0
func (self *Slave) IsAlive(cpm time.Time) bool {
	return self.lastUpdate.Add(config.HeartBeatInterval() * 2).After(cpm)
}