Route network UI callbacks through UI queue
This commit is contained in:
committed by
Brandon McGinty
parent
12761f29ca
commit
d50c6726ad
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user