// Add will enqueue the Component to run it,
// last added component will be started first
Add will enqueue the Component to run it,
last added component will be started first
// Add will enqueue the Component to run it // last added component will be started first
func (m *manager) Add(c Component) error {
	m.mu.Lock()
	defer m.mu.Unlock()
	if m.stopping {
		return errors.New("can't accept new component as stop procedure is already engaged")
	}
	if m.started {
		return errors.New("can't accept new component as manager has already started")
	}
	m.components = append(m.components, c)
	return nil
}
func ( m * manager ) Add ( c Component ) error { m . mu . Lock ( ) defer m . mu . Unlock ( ) if m . stopping { return errors . New ( " " ) } if m . started { return errors . New ( " " ) } m . components = append ( m . components , c ) return nil }
Add will enqueue the Component to run it,
last added component will be started first
Add will enqueue the Component to run it last added component will be started first