pub struct InactivityDetector { /* private fields */ }Expand description
Inactivity detector for detecting session timeouts
This is the TERTIARY layer with ~90% reliability. It triggers when an agent session has been inactive for too long.
Implementations§
Source§impl InactivityDetector
impl InactivityDetector
Sourcepub fn with_threshold(threshold: Duration) -> Self
pub fn with_threshold(threshold: Duration) -> Self
Create with custom threshold
Sourcepub fn with_check_interval(self, interval: Duration) -> Self
pub fn with_check_interval(self, interval: Duration) -> Self
Set check interval
Sourcepub fn subscribe(&self) -> Receiver<MonitorEvent>
pub fn subscribe(&self) -> Receiver<MonitorEvent>
Subscribe to events
Sourcepub async fn record_activity(&self, agent_type: &str)
pub async fn record_activity(&self, agent_type: &str)
Record activity for an agent
Sourcepub async fn is_inactive(&self, agent_type: &str) -> bool
pub async fn is_inactive(&self, agent_type: &str) -> bool
Check if agent is inactive
Sourcepub async fn get_inactive_duration(&self, agent_type: &str) -> Option<Duration>
pub async fn get_inactive_duration(&self, agent_type: &str) -> Option<Duration>
Get inactive duration
Sourcepub async fn start_monitoring(&self, agent_types: Vec<String>)
pub async fn start_monitoring(&self, agent_types: Vec<String>)
Start monitoring for inactivity
Sourcepub async fn stop_monitoring(&self)
pub async fn stop_monitoring(&self)
Stop monitoring
Sourcepub async fn clear_activity(&self, agent_type: &str)
pub async fn clear_activity(&self, agent_type: &str)
Clear activity for an agent
Trait Implementations§
Source§impl Clone for InactivityDetector
impl Clone for InactivityDetector
Source§fn clone(&self) -> InactivityDetector
fn clone(&self) -> InactivityDetector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InactivityDetector
impl !RefUnwindSafe for InactivityDetector
impl Send for InactivityDetector
impl Sync for InactivityDetector
impl Unpin for InactivityDetector
impl UnsafeUnpin for InactivityDetector
impl !UnwindSafe for InactivityDetector
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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