Skip to content
Myr

fix: send batch commands to cmds channel instead of executing them in event loop (#1473)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

We shouldn't execute commands in the event loop ourselves. Instead, we should send them to the commands channel where the command handlers will take care of executing them.

authored by Ayman Bagabas · committed by GitHub · parent 9aae1f0 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Fixes: f5da8d068af7 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
  • Supersedes: https://github.com/charmbracelet/bubbletea/pull/1485

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:tea.go+5 added-1 removed
473 unmodified lines
474 for _, cmd := range msg {475 if cmd == nil {476 continue477 }478 go p.Send(cmd())478 select {479 case <-p.ctx.Done():480 return model, nil481 case cmds <- cmd:482 }483 }484 continue485486 case sequenceMsg:
429 unmodified lines