MCPcopy Index your code
hub / github.com/riverqueue/river / StopAllParallel

Function StopAllParallel

rivershared/startstop/start_stop.go:296–309  ·  view source on GitHub ↗

StopAllParallel stops all the given services in parallel and waits until they've all stopped successfully.

(services ...Service)

Source from the content-addressed store, hash-verified

294// StopAllParallel stops all the given services in parallel and waits until
295// they've all stopped successfully.
296func StopAllParallel(services ...Service) {
297 var wg sync.WaitGroup
298 wg.Add(len(services))
299
300 for i := range services {
301 service := services[i]
302 go func() {
303 defer wg.Done()
304 service.Stop()
305 }()
306 }
307
308 wg.Wait()
309}
310
311// WaitAllStarted waits until all the given services are started (or stopped in
312// a degenerate start scenario, like if context is cancelled while starting up).

Callers 5

StartMethod · 0.92
StartMethod · 0.92
StartMethod · 0.92
StartAllFunction · 0.85
TestStopAllParallelFunction · 0.85

Calls 3

DoneMethod · 0.80
StopMethod · 0.65
AddMethod · 0.45

Tested by 1

TestStopAllParallelFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…