Skip to main content

shell_tunnel/session/
mod.rs

1//! Session management module.
2//!
3//! This module provides types and utilities for managing shell sessions,
4//! including session identification, state tracking, and storage.
5
6mod busy;
7mod context;
8mod id;
9mod state;
10mod store;
11
12use std::time::Duration;
13
14/// How long a session may sit idle before it is swept.
15///
16/// The same hour upload sessions have used since they were introduced
17/// (`fs::SESSION_TTL`), and deliberately the same figure rather than a second
18/// one to reason about: both answer "how long does an abandoned thing stay?" for
19/// the same product, and an operator who has learned one should not have to
20/// learn the other. Kept as its own constant because the two are different
21/// resources — an upload session holds an open file handle and a staging file,
22/// a shell session holds bookkeeping — and either may need to move without the
23/// other.
24///
25/// Comfortably above `execution::MAX_TIMEOUT`, so a session cannot age out
26/// merely because one long command ran in it.
27pub const IDLE_TTL: Duration = Duration::from_secs(3600);
28
29pub(crate) use busy::BusySession;
30pub use context::SessionContext;
31pub use id::SessionId;
32pub use state::SessionState;
33pub use store::{Session, SessionStore};