func (self *SlaveManager) Exam() { // TODO verify c := time.Tick(config.HeartBeatInterval() * 3) for _ = range c { println("tick") go self.examSlaveAliveRoutine() go self.examSlaveBlockRoutine() } }
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() } }
func (self *Slave) IsAlive(cpm time.Time) bool { return self.lastUpdate.Add(config.HeartBeatInterval() * 2).After(cpm) }