Route network UI callbacks through UI queue

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 19:47:14 -04:00
committed by Brandon McGinty
parent 12761f29ca
commit d50c6726ad
3 changed files with 30 additions and 22 deletions
+8
View File
@@ -37,6 +37,14 @@ func esc(str string) string {
return sanitize.HTML(clean)
}
// postUI is the only path network and audio callbacks use to touch terminal
// widgets. Work is dropped during shutdown or queue overload.
func (b *Barnard) postUI(fn func()) {
if b.Ui != nil {
b.Ui.Post(fn)
}
}
func (b *Barnard) Notify(event string, who string, what string) {
// Notifications are best-effort: a slow external command must not block a
// UI or network callback. New events are dropped once the bounded queue is full.