improve status message handling
This commit is contained in:
parent
57a2210d8d
commit
f463ce6694
10 changed files with 140 additions and 84 deletions
10
cmd/root.go
10
cmd/root.go
|
|
@ -107,6 +107,16 @@ func setupSubscriptions(app *app.App) (chan tea.Msg, func()) {
|
|||
wg.Done()
|
||||
}()
|
||||
}
|
||||
{
|
||||
sub := app.Status.Subscribe(ctx)
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
for ev := range sub {
|
||||
ch <- ev
|
||||
}
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
return ch, func() {
|
||||
cancel()
|
||||
wg.Wait()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue