Skip to main content

close_workspace

Function close_workspace 

Source
async fn close_workspace(state: &AppState, ws_id: String)
Expand description

Delete a closed window’s workspace, every agent in it closed gracefully first (agent_teardown, Policy::close()).

Detached (agent_teardown::detached): the host waits only 2 s for CloseWindow, less than a graceful close takes, and when it hangs up this handler is dropped. The close still finishes, and on app exit srv waits for it.

A workspace the reducer tracks goes through the delete_workspace saga (reducer and store stay consistent, durable provenance). One it never knew — the usual case when its window diverged too (#2051) — would make the saga’s reducer dispatch error out, so its agents are closed here, the store cascades directly, and each block’s close is finished as the saga would (close_pane::finish_close).