MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / triggerStop

Method triggerStop

service/pool_impl.go:158–179  ·  view source on GitHub ↗
(shutdownContext context.Context)

Source from the content-addressed store, hash-verified

156}
157
158func (p *pool) triggerStop(shutdownContext context.Context) {
159 p.mutex.Lock()
160 if p.stopping {
161 p.mutex.Unlock()
162 return
163 }
164 p.stopping = true
165 svc := p.services
166 p.mutex.Unlock()
167
168 wg := &sync.WaitGroup{}
169 wg.Add(len(svc))
170 for _, s := range svc {
171 service := s
172 l := p.lifecycles[service]
173 go func() {
174 defer wg.Done()
175 l.Stop(shutdownContext)
176 }()
177 }
178 wg.Wait()
179}

Callers 2

processRunningMethod · 0.95
onServiceStateChangeMethod · 0.95

Calls 3

AddMethod · 0.65
StopMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected