MCPcopy
hub / github.com/grafana/dskit / ServicesByState

Method ServicesByState

services/manager.go:162–171  ·  view source on GitHub ↗

ServicesByState provides a snapshot of the current state of all the services under management.

()

Source from the content-addressed store, hash-verified

160
161// ServicesByState provides a snapshot of the current state of all the services under management.
162func (m *Manager) ServicesByState() map[State][]Service {
163 m.mu.Lock()
164 defer m.mu.Unlock()
165
166 result := map[State][]Service{}
167 for st, ss := range m.byState {
168 result[st] = append([]Service(nil), ss...) // make a copy
169 }
170 return result
171}
172
173func (m *Manager) serviceStateChanged(s Service, from State, to State) {
174 m.mu.Lock()

Calls

no outgoing calls