-
Notifications
You must be signed in to change notification settings - Fork 0
systems session store
Active contributors: Douwe de Vries
The session store keeps loaded CSVs, column metadata, suggested mappings, comparison config, and results in memory. It is shared by the local web server and desktop wrapper.
src/backend/
├── store.rs
└── session.rs
src/api/state.rs
| Name | File | Description |
|---|---|---|
SessionStore |
src/backend/store.rs |
Thread-safe in-memory store with eviction. |
SessionData |
src/backend/session.rs |
Per-session data model. |
data_revision |
src/backend/session.rs |
Monotonic marker used to reject stale writes. |
AppState |
src/api/state.rs |
Axum-facing cloneable state wrapper. |
SessionStore wraps a HashMap and insertion order queue behind parking_lot::RwLock. It evicts idle sessions, limits session count, and evicts least-recently-accessed sessions when total estimated bytes exceed the configured budget.
graph TD
Create[create session] --> Store[SessionStore]
Load[load CSV] --> Session[SessionData]
Compare[run comparison] --> Revision[data_revision check]
Revision --> Results[store results]
Store --> Evict[idle/count/byte eviction]
src/api/state.rs creates the HTTP-facing state. src-tauri/src/main.rs manages an Arc<SessionStore> for desktop commands. src/backend/workflow.rs is the main caller of with_session and with_session_mut.
Change session capacity or eviction behavior in src/backend/store.rs. Change stored workflow state in src/backend/session.rs, then update snapshot, export, and response tests if the data affects persistence.
| File | Purpose |
|---|---|
src/backend/store.rs |
Store creation, session CRUD, eviction, byte estimation. |
src/backend/session.rs |
Stored session fields and estimated size helpers. |
src/api/state.rs |
Axum state wrapper and session helpers. |
src-tauri/src/main.rs |
Desktop SessionStore registration. |