forge_core/realtime/mod.rs
1//! Real-time subscription system.
2//!
3//! Forge provides automatic real-time updates via PostgreSQL LISTEN/NOTIFY.
4//! When tables change, affected subscriptions are invalidated and re-executed.
5//!
6//! # Architecture
7//!
8//! ```text
9//! Client Gateway PostgreSQL
10//! │ │ │
11//! │─── Subscribe ───────>│ │
12//! │ │── Execute query ───────>│
13//! │<── Initial data ─────│<── Results ────────────│
14//! │ │ │
15//! │ │<── NOTIFY on change ───│
16//! │ │── Re-execute query ───>│
17//! │<── Delta update ─────│<── New results ────────│
18//! ```
19//!
20//! # Key Types
21//!
22//! - [`ReadSet`] - Tables a subscription depends on
23//! - [`SessionInfo`] - WebSocket connection state
24//! - [`SubscriptionInfo`] - Active subscription with query parameters
25//! - [`Delta`] - Change payload sent to clients
26
27mod readset;
28mod session;
29mod subscription;
30
31pub use readset::{Change, ChangeOperation, ReadSet, TrackingMode};
32pub use session::{SessionId, SessionInfo, SessionStatus};
33pub use subscription::{Delta, SubscriptionId, SubscriptionInfo, SubscriptionState};