pub struct PollingTask { /* private fields */ }Expand description
A single polling task with state management
Implementations§
Source§impl PollingTask
impl PollingTask
Sourcepub fn start(
registration_id: RegistrationId,
speaker_service_pair: SpeakerServicePair,
initial_interval: Duration,
max_interval: Duration,
adaptive_polling: bool,
device_poller: Arc<DeviceStatePoller>,
event_sender: UnboundedSender<EnrichedEvent>,
) -> Self
pub fn start( registration_id: RegistrationId, speaker_service_pair: SpeakerServicePair, initial_interval: Duration, max_interval: Duration, adaptive_polling: bool, device_poller: Arc<DeviceStatePoller>, event_sender: UnboundedSender<EnrichedEvent>, ) -> Self
Create and start a new polling task
Sourcepub fn registration_id(&self) -> RegistrationId
pub fn registration_id(&self) -> RegistrationId
Get the registration ID for this task
Sourcepub fn speaker_service_pair(&self) -> &SpeakerServicePair
pub fn speaker_service_pair(&self) -> &SpeakerServicePair
Get the speaker/service pair for this task
Sourcepub fn current_interval(&self) -> Duration
pub fn current_interval(&self) -> Duration
Get the current polling interval
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the task is still running
Sourcepub async fn stats(&self) -> PollingTaskStats
pub async fn stats(&self) -> PollingTaskStats
Get task statistics
Sourcepub async fn shutdown(self) -> PollingResult<()>
pub async fn shutdown(self) -> PollingResult<()>
Request graceful shutdown of this polling task
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PollingTask
impl !RefUnwindSafe for PollingTask
impl Send for PollingTask
impl Sync for PollingTask
impl Unpin for PollingTask
impl UnsafeUnpin for PollingTask
impl !UnwindSafe for PollingTask
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