// Check the service once every waitTimePerCycle millisecond until timeout.
// Default timeout is totalWaitTime seconds.
Check the service once every waitTimePerCycle millisecond until timeout.
Default timeout is totalWaitTime seconds.
// Check the service once every waitTimePerCycle millisecond until timeout . // Default timeout is totalWaitTime seconds .
func ProbeMgoService(service model.Service) bool {
	log.Printf("probing service %v", service.Id)
	timeOutChan := make(chan string)
	serviceUpChan := make(chan string)
	go probeMgoService(service, timeOutChan, serviceUpChan)
	select {
	case <-serviceUpChan:
		return true 
	case <-time.After(totalProbeTime):
		close(timeOutChan) 
		return false
	}
}
func ProbeMgoService ( service model . Service ) bool { log . Printf ( " " , service . Id ) timeOutChan := make ( chan string ) serviceUpChan := make ( chan string ) go probeMgoService ( service , timeOutChan , serviceUpChan ) select { case <- serviceUpChan : return true case <- time . After ( totalProbeTime ) : close ( timeOutChan ) return false } }
Check the service once every waitTimePerCycle millisecond until timeout.
Check the service once every waitTimePerCycle millisecond until timeout .
//Service is up. //Timeout is reached. Stop waiting.