Add app.IterateComponents method. This method helps to create debugging HTTP handlers in Heart
This commit is contained in:
parent
ff3fc68451
commit
fa178d7c26
@ -262,6 +262,14 @@ func (app *App) Start(ctx context.Context) (err error) {
|
|||||||
return
|
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 {
|
func stackAllGoroutines() []byte {
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
for {
|
for {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user