1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-11 18:20:28 +09:00

Add app.IterateComponents method. This method helps to create debugging HTTP handlers in Heart

This commit is contained in:
Sergey 2023-06-21 13:50:50 +05:00
parent ff3fc68451
commit fa178d7c26
No known key found for this signature in database
GPG key ID: 3B6BEF79160221C6

View file

@ -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 {