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:
parent
ff3fc68451
commit
fa178d7c26
1 changed files with 8 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue