Skip to main content

close_all

Function close_all 

Source
pub fn close_all(state: &DispatchState, reason: CloseReason, budget: Duration)
Expand description

Close every live session’s resource with reason and forget the slots.

This is the shutdown path: a stopped client must not leave resources behind that only it can address, and each backend’s own record of the resource — the Orca tab map included — ends with the session. budget bounds the whole sweep, because an operator’s SIGTERM must not turn into a hang while a slow backend CLI exits; whatever the budget cuts off is reported and dropped anyway.

The order is deliberate: every slot is taken off this client’s books under the dispatch lock — untracked and removed, so nothing still reads a live session — and the closes it collected run once the lock is let go. A shutdown that closed each pane while holding that lock spent the whole budget on the host, with the lock no adapter frame could reach.