pub struct SessionManager { /* private fields */ }Expand description
Session management service with timeout monitoring
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn with_config(config: SessionManagerConfig) -> Self
pub fn with_config(config: SessionManagerConfig) -> Self
Create new session manager with custom config
Sourcepub async fn start(&mut self) -> ApplicationResult<()>
pub async fn start(&mut self) -> ApplicationResult<()>
Start the session manager with automatic cleanup
Sourcepub async fn stop(&mut self) -> ApplicationResult<()>
pub async fn stop(&mut self) -> ApplicationResult<()>
Stop the session manager
Sourcepub async fn add_session(
&self,
session: StreamSession,
) -> ApplicationResult<SessionId>
pub async fn add_session( &self, session: StreamSession, ) -> ApplicationResult<SessionId>
Add session to management
Sourcepub async fn get_session(
&self,
session_id: &SessionId,
) -> Option<Arc<RwLock<StreamSession>>>
pub async fn get_session( &self, session_id: &SessionId, ) -> Option<Arc<RwLock<StreamSession>>>
Get session by ID
Sourcepub async fn remove_session(
&self,
session_id: &SessionId,
) -> ApplicationResult<bool>
pub async fn remove_session( &self, session_id: &SessionId, ) -> ApplicationResult<bool>
Remove session from management
Sourcepub async fn cleanup_expired_sessions(&self) -> ApplicationResult<CleanupReport>
pub async fn cleanup_expired_sessions(&self) -> ApplicationResult<CleanupReport>
Force cleanup of expired sessions
Sourcepub async fn stats(&self) -> SessionManagerStats
pub async fn stats(&self) -> SessionManagerStats
Get current statistics
Trait Implementations§
Source§impl Default for SessionManager
impl Default for SessionManager
Auto Trait Implementations§
impl Freeze for SessionManager
impl !RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl !UnwindSafe for SessionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more