pub struct SessionLifecycleConfig {
pub max_session_duration: Duration,
pub max_messages_per_session: u32,
pub session_timeout: Duration,
}Expand description
Configuration for session lifecycle management.
Defines limits and timeouts that determine when sessions should be automatically closed to prevent resource exhaustion and ensure fair processing distribution.
§Examples
use queue_runtime::SessionLifecycleConfig;
use std::time::Duration;
let config = SessionLifecycleConfig {
max_session_duration: Duration::from_secs(2 * 60 * 60), // 2 hours
max_messages_per_session: 1000,
session_timeout: Duration::from_secs(30 * 60), // 30 minutes
};
// Check if defaults are reasonable
assert_eq!(config.max_session_duration, Duration::from_secs(7200));Fields§
§max_session_duration: DurationMaximum duration a session can be active before forced closure.
max_messages_per_session: u32Maximum number of messages processed per session before forced closure.
session_timeout: DurationMaximum idle time before session is considered timed out.
Trait Implementations§
Source§impl Clone for SessionLifecycleConfig
impl Clone for SessionLifecycleConfig
Source§fn clone(&self) -> SessionLifecycleConfig
fn clone(&self) -> SessionLifecycleConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionLifecycleConfig
impl Debug for SessionLifecycleConfig
Auto Trait Implementations§
impl Freeze for SessionLifecycleConfig
impl RefUnwindSafe for SessionLifecycleConfig
impl Send for SessionLifecycleConfig
impl Sync for SessionLifecycleConfig
impl Unpin for SessionLifecycleConfig
impl UnsafeUnpin for SessionLifecycleConfig
impl UnwindSafe for SessionLifecycleConfig
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