MCPcopy
hub / github.com/go-kit/kit / loop

Method loop

sd/etcd/instancer.go:42–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func (s *Instancer) loop() {
43 ch := make(chan struct{})
44 go s.client.WatchPrefix(s.prefix, ch)
45 for {
46 select {
47 case <-ch:
48 instances, err := s.client.GetEntries(s.prefix)
49 if err != nil {
50 s.logger.Log("msg", "failed to retrieve entries", "err", err)
51 s.cache.Update(sd.Event{Err: err})
52 continue
53 }
54 s.cache.Update(sd.Event{Instances: instances})
55
56 case <-s.quitc:
57 return
58 }
59 }
60}
61
62// Stop terminates the Instancer.
63func (s *Instancer) Stop() {

Callers 1

NewInstancerFunction · 0.95

Implementers 9

Instancersd/etcd/instancer.go
Instancersd/dnssrv/instancer.go
Instancersd/consul/instancer.go
Cachesd/internal/instance/cache.go
fakeClientsd/zk/util_test.go
Instancersd/zk/instancer.go
clientsd/zk/client.go
Instancersd/etcdv3/instancer.go
Instancersd/eureka/instancer.go

Calls 4

WatchPrefixMethod · 0.65
GetEntriesMethod · 0.65
LogMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected