// Run starts running the registered components. The components will stop running
// when the context is closed. Run blocks until the context is closed or
// an error occurs.
Run starts running the registered components. The components will stop running
when the context is closed. Run blocks until the context is closed or
an error occurs.
// Run starts running the registered components . The components will stop running // when the context is closed . Run blocks until the context is closed or // an error occurs .
func (m *manager) Run(ctx context.Context) (err error) {
	m.internalCtx, m.internalCancel = context.WithCancel(ctx)
	defer func() {
		if stopErr := m.engageStopProcedure(); stopErr != nil {
			err = stopErr
		}
	}()
	m.errChan = make(chan error)
	go m.start()
	select {
	case <-ctx.Done():
		return
	case err := <-m.errChan:
		return err
	}
}
func ( m * manager ) Run ( ctx context . Context ) ( err error ) { m . internalCtx , m . internalCancel = context . WithCancel ( ctx ) defer func ( ) { if stopErr := m . engageStopProcedure ( ) ; stopErr != nil { err = stopErr } } ( ) m . errChan = make ( chan error ) go m . start ( ) select { case <- ctx . Done ( ) : return case err := <- m . errChan : return err } }
Run starts running the registered components.
Run starts running the registered components .