components signal
This commit is contained in:
parent
eb66692b47
commit
f9109382cb
@ -33,7 +33,8 @@ func NewManager() *Manager {
|
||||
type ComponentsAreReady struct {
|
||||
}
|
||||
|
||||
func (m *Manager) RunNonBlocking(ctx context.Context) error {
|
||||
func (m *Manager) RunNonBlocking(ctx context.Context, readyChan chan ComponentsAreReady) error {
|
||||
go func() error {
|
||||
m.initLifetime()
|
||||
err := m.init(ctx)
|
||||
if err != nil {
|
||||
@ -45,6 +46,8 @@ func (m *Manager) RunNonBlocking(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
readyChan <- ComponentsAreReady{}
|
||||
|
||||
err = m.wait(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -55,6 +58,8 @@ func (m *Manager) RunNonBlocking(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Manager) Run(ctx context.Context) error {
|
||||
|
Loading…
Reference in New Issue
Block a user