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

Method AwaitStopped

services/manager.go:152–159  ·  view source on GitHub ↗

AwaitStopped waits for the ServiceManager to become stopped. Returns nil, if manager is stopped, error when context finishes earlier.

(ctx context.Context)

Source from the content-addressed store, hash-verified

150
151// AwaitStopped waits for the ServiceManager to become stopped. Returns nil, if manager is stopped, error when context finishes earlier.
152func (m *Manager) AwaitStopped(ctx context.Context) error {
153 select {
154 case <-ctx.Done():
155 return ctx.Err()
156 case <-m.stoppedCh:
157 return nil
158 }
159}
160
161// ServicesByState provides a snapshot of the current state of all the services under management.
162func (m *Manager) ServicesByState() map[State][]Service {

Calls 2

DoneMethod · 0.65
ErrMethod · 0.45