StartManagerAndAwaitHealthy starts the manager (which in turns starts all services managed by it), and then waits until it reaches Running state. All services that this manager manages must be in New state, otherwise starting will fail. Notice that context passed to the manager for starting its ser
(ctx context.Context, manager *Manager)
| 372 | // |
| 373 | // Notice that context passed to the manager for starting its services is the same as context used for waiting! |
| 374 | func StartManagerAndAwaitHealthy(ctx context.Context, manager *Manager) error { |
| 375 | err := manager.StartAsync(ctx) |
| 376 | if err != nil { |
| 377 | return err |
| 378 | } |
| 379 | |
| 380 | return manager.AwaitHealthy(ctx) |
| 381 | } |
| 382 | |
| 383 | // StopManagerAndAwaitStopped asks manager to stop its services, and then waits |
| 384 | // until manager reaches the stopped state or context is stopped. |