MCPcopy
hub / github.com/docker/docker-agent / applyPauseEvent

Method applyPauseEvent

pkg/tui/tui.go:1246–1260  ·  view source on GitHub ↗

applyPauseEvent advances a session's pause indicator in response to runtime events. The runtime emits a PausedEvent when the loop reaches an iteration boundary and blocks, which flips a pending "Pausing…" state to "Paused". A stream that stops while still "Pausing…" (e.g. the agent happened to finis

(ss *service.SessionState, msg tea.Msg)

Source from the content-addressed store, hash-verified

1244// resolved to "Paused", since /pause stays armed for the next run. The arm/
1245// disarm transitions themselves are driven by handleTogglePause.
1246func (m *appModel) applyPauseEvent(ss *service.SessionState, msg tea.Msg) {
1247 if ss == nil {
1248 return
1249 }
1250 switch msg.(type) {
1251 case *runtime.PausedEvent:
1252 if ss.PauseState() != service.PauseNone {
1253 ss.SetPauseState(service.PausePaused)
1254 }
1255 case *runtime.StreamStoppedEvent:
1256 if ss.PauseState() == service.PausePausing {
1257 ss.SetPauseState(service.PausePaused)
1258 }
1259 }
1260}
1261
1262// handleWorkingStateChanged updates the editor working indicator and resize handle spinner.
1263func (m *appModel) handleWorkingStateChanged(msg messages.WorkingStateChangedMsg) (tea.Model, tea.Cmd) {

Callers 2

updateMethod · 0.95
handleRoutedMsgMethod · 0.95

Calls 2

SetPauseStateMethod · 0.80
PauseStateMethod · 0.65

Tested by

no test coverage detected