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)
| 331 | // because the services themselves have already background themselves, and we |
| 332 | // have to wait until the slowest service has started anyway. |
| 333 | func 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 | } |
searching dependent graphs…