示例#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()
	}
}
示例#2
0
文件: exam.go 项目: proj-223/CatFs
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()
	}
}
示例#3
0
func (self *Slave) IsAlive(cpm time.Time) bool {
	return self.lastUpdate.Add(config.HeartBeatInterval() * 2).After(cpm)
}