pub struct EventDetector { /* private fields */ }Expand description
Monitors event activity and detects when polling fallback is needed
Implementations§
Source§impl EventDetector
impl EventDetector
Sourcepub fn new(event_timeout: Duration, polling_activation_delay: Duration) -> Self
pub fn new(event_timeout: Duration, polling_activation_delay: Duration) -> Self
Create a new EventDetector
Sourcepub fn set_firewall_coordinator(
&mut self,
coordinator: Arc<FirewallDetectionCoordinator>,
)
pub fn set_firewall_coordinator( &mut self, coordinator: Arc<FirewallDetectionCoordinator>, )
Set the firewall coordinator (must be called during initialization)
Sourcepub fn set_polling_request_sender(
&mut self,
sender: UnboundedSender<PollingRequest>,
)
pub fn set_polling_request_sender( &mut self, sender: UnboundedSender<PollingRequest>, )
Set the polling request sender
Sourcepub async fn record_event(&self, registration_id: RegistrationId)
pub async fn record_event(&self, registration_id: RegistrationId)
Record that an event was received for a registration
Sourcepub async fn should_start_polling(
&self,
registration_id: RegistrationId,
) -> bool
pub async fn should_start_polling( &self, registration_id: RegistrationId, ) -> bool
Check if a registration should start polling based on event timeout
Sourcepub async fn should_stop_polling(&self, registration_id: RegistrationId) -> bool
pub async fn should_stop_polling(&self, registration_id: RegistrationId) -> bool
Check if a registration should stop polling (events have resumed)
Sourcepub async fn evaluate_firewall_status(
&self,
registration_id: RegistrationId,
pair: &SpeakerServicePair,
) -> Option<PollingRequest>
pub async fn evaluate_firewall_status( &self, registration_id: RegistrationId, pair: &SpeakerServicePair, ) -> Option<PollingRequest>
Evaluate firewall status and make immediate polling decision
Sourcepub async fn start_monitoring(&self) -> JoinHandle<()>
pub async fn start_monitoring(&self) -> JoinHandle<()>
Start monitoring event activity for all registered subscriptions. Returns the JoinHandle for the spawned monitoring task.
Sourcepub async fn register_subscription(
&self,
registration_id: RegistrationId,
pair: SpeakerServicePair,
)
pub async fn register_subscription( &self, registration_id: RegistrationId, pair: SpeakerServicePair, )
Register a new subscription for monitoring with its speaker/service pair
Sourcepub async fn unregister_subscription(&self, registration_id: RegistrationId)
pub async fn unregister_subscription(&self, registration_id: RegistrationId)
Unregister a subscription from monitoring
Sourcepub async fn stats(&self) -> EventDetectorStats
pub async fn stats(&self) -> EventDetectorStats
Get monitoring statistics
Auto Trait Implementations§
impl Freeze for EventDetector
impl !RefUnwindSafe for EventDetector
impl Send for EventDetector
impl Sync for EventDetector
impl Unpin for EventDetector
impl UnsafeUnpin for EventDetector
impl !UnwindSafe for EventDetector
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