()
| 120 | |
| 121 | impl ServerState { |
| 122 | pub fn new() -> Self { |
| 123 | let (tx, _) = broadcast::channel(1024); |
| 124 | Self { |
| 125 | sessions: Mutex::new(SessionManager::new()), |
| 126 | providers: ProviderRegistry::new(), |
| 127 | auth_manager: Arc::new(AuthManager::new()), |
| 128 | event_bus: tx, |
| 129 | session_repo: None, |
| 130 | message_repo: None, |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | pub async fn new_with_storage() -> anyhow::Result<Self> { |
| 135 | Self::new_with_storage_for_url(DEFAULT_SERVER_URL.to_string()).await |