func DetectFailure(client *etcd.Client, name string, stop chan bool) error {
	receiver := make(chan *etcd.Response, 1)
	go client.Watch(HealthyPath(name), 0, true, receiver, stop)
	for resp := range receiver {
		if resp.Action != "expire" && resp.Action != "delete" {
			continue
		}
		if err := ReportFailure(client, name, path.Base(resp.Node.Key)); err != nil {
			return err
		}
	}
	return nil
}
// detect failure of the given taskID
detect failure of the given taskID
// detect failure of the given taskID
func DetectFailure(client *etcd.Client, name string, stop chan bool) error {
	receiver := make(chan *etcd.Response, 1)
	go client.Watch(HealthyPath(name), 0, true, receiver, stop)
	for resp := range receiver {
		if resp.Action != "expire" && resp.Action != "delete" {
			continue
		}
		if err := ReportFailure(client, name, path.Base(resp.Node.Key)); err != nil {
			return err
		}
	}
	return nil
}
func DetectFailure ( client * etcd . Client , name string , stop chan bool ) error { receiver := make ( chan * etcd . Response , 1 ) go client . Watch ( HealthyPath ( name ) , 0 , true , receiver , stop ) for resp := range receiver { if resp . Action != " " && resp . Action != " " { continue } if err := ReportFailure ( client , name , path . Base ( resp . Node . Key ) ) ; err != nil { return err } } return nil }
detect failure of the given taskID
detect failure of the given taskID