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

Function StartAll

rivershared/startstop/start_stop.go:283–292  ·  view source on GitHub ↗

StartAll starts all given services. If any service returns an error while being started, that error is returned, and any services that were started successfully up to that point are stopped.

(ctx context.Context, services ...Service)

Source from the content-addressed store, hash-verified

281// being started, that error is returned, and any services that were started
282// successfully up to that point are stopped.
283func StartAll(ctx context.Context, services ...Service) error {
284 for i, service := range services {
285 if err := service.Start(ctx); err != nil {
286 StopAllParallel(services[0:i]...)
287
288 return err
289 }
290 }
291 return nil
292}
293
294// StopAllParallel stops all the given services in parallel and waits until
295// they've all stopped successfully.

Callers 3

StartMethod · 0.92
StartMethod · 0.92
TestStartAllFunction · 0.85

Calls 2

StopAllParallelFunction · 0.85
StartMethod · 0.65

Tested by 1

TestStartAllFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…