feat: add multi-node horizontal scaling foundations
NotificationBus for cross-node message delivery fan-out: - NotificationBus trait: publish(topic) + subscribe(topic) -> Notify - InMemoryNotificationBus: single-node default via tokio::sync::Notify - Designed for Redis pub/sub or NATS replacement in multi-node deploys - 3 async tests: publish wakes, timeout without publish, independent topics Health endpoint enhancements for load balancer awareness: - HealthResponse proto: add node_id, version, uptime_secs, storage_backend - ServerState: add node_id, start_time, storage_backend fields - Health handler returns full node identity for multi-node monitoring
This commit is contained in:
@@ -57,6 +57,12 @@ pub struct ServerState {
|
||||
pub banned_users: Arc<DashMap<Vec<u8>, BanRecord>>,
|
||||
/// Moderation reports (append-only).
|
||||
pub moderation_reports: Arc<std::sync::Mutex<Vec<ModerationReport>>>,
|
||||
/// Unique node identifier for multi-node health reporting.
|
||||
pub node_id: String,
|
||||
/// Process start time for uptime calculation.
|
||||
pub start_time: std::time::Instant,
|
||||
/// Storage backend name (e.g. "sql", "file").
|
||||
pub storage_backend: String,
|
||||
}
|
||||
|
||||
/// A ban record for a user.
|
||||
|
||||
Reference in New Issue
Block a user