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

Function WaitAllStartedC

rivershared/startstop/start_stop.go:333–344  ·  view source on GitHub ↗

WaitAllStartedC waits until all the given services are started (or stopped in a degenerate start scenario, like if context is cancelled while starting up). This variant returns a channel so that a caller can apply a timeout branch with `select` if they'd like. For the most part this shouldn't be ne

(services ...Service)

Source from the content-addressed store, hash-verified

331// because the services themselves have already background themselves, and we
332// have to wait until the slowest service has started anyway.
333func WaitAllStartedC(services ...Service) <-chan struct{} {
334 allStarted := make(chan struct{})
335
336 go func() {
337 defer close(allStarted)
338 for _, service := range services {
339 <-service.Started()
340 }
341 }()
342
343 return allStarted
344}

Callers 5

TestClientPilotPluginFunction · 0.92
TestPeriodicJobEnqueuerFunction · 0.92
WaitAllStartedFunction · 0.85
TestStartAllFunction · 0.85
TestWaitAllStartedCFunction · 0.85

Calls 1

StartedMethod · 0.65

Tested by 4

TestClientPilotPluginFunction · 0.74
TestPeriodicJobEnqueuerFunction · 0.74
TestStartAllFunction · 0.68
TestWaitAllStartedCFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…