diff --git a/app/app.go b/app/app.go index 21f2f52c..2295cdbf 100644 --- a/app/app.go +++ b/app/app.go @@ -262,6 +262,14 @@ func (app *App) Start(ctx context.Context) (err error) { return } +func (app *App) IterateComponents(fn func(Component)) { + app.mu.RLock() + defer app.mu.RUnlock() + for _, s := range app.components { + fn(s) + } +} + func stackAllGoroutines() []byte { buf := make([]byte, 1024) for {