// NewInstancer returns a Eureka Instancer. It will start watching the given
// app string for changes, and update the subscribers accordingly.
NewInstancer returns a Eureka Instancer. It will start watching the given
app string for changes, and update the subscribers accordingly.
// NewInstancer returns a Eureka Instancer . It will start watching the given // app string for changes and update the subscribers accordingly .
func NewInstancer(conn fargoConnection, app string, logger log.Logger) *Instancer {
	logger = log.With(logger, "app", app)
	s := &Instancer{
		cache:  instance.NewCache(),
		conn:   conn,
		app:    app,
		logger: logger,
		quitc:  make(chan chan struct{}),
	}
	instances, err := s.getInstances()
	if err == nil {
		s.logger.Log("instances", len(instances))
	} else {
		s.logger.Log("during", "getInstances", "err", err)
	}
	s.cache.Update(sd.Event{Instances: instances, Err: err})
	go s.loop()
	return s
}
func NewInstancer ( conn fargoConnection , app string , logger log . Logger ) * Instancer { logger = log . With ( logger , " " , app ) s := & Instancer { cache : instance . NewCache ( ) , conn : conn , app : app , logger : logger , quitc : make ( chan chan struct { } ) , } instances , err := s . getInstances ( ) if err == nil { s . logger . Log ( " " , len ( instances ) ) } else { s . logger . Log ( " " , " " , " " , err ) } s . cache . Update ( sd . Event { Instances : instances , Err : err } ) go s . loop ( ) return s }
NewInstancer returns a Eureka Instancer.
NewInstancer returns a Eureka Instancer .