pub struct StreamWatchdog {
pub enabled: bool,
pub idle_timeout_ms: u64,
pub warning_threshold_ms: u64,
pub aborted: bool,
pub watchdog_fired_at: Option<u128>,
}Expand description
Manages the stream idle timeout watchdog. Matches TypeScript’s streamIdleTimer/streamIdleWarningTimer logic.
Fields§
§enabled: boolWhether the watchdog is enabled
idle_timeout_ms: u64Idle timeout in milliseconds
warning_threshold_ms: u64Warning threshold in milliseconds
aborted: boolWhether the stream was aborted by the watchdog
watchdog_fired_at: Option<u128>When the watchdog fired (performance.now() snapshot)
Implementations§
Source§impl StreamWatchdog
impl StreamWatchdog
pub fn new(enabled: bool, idle_timeout_ms: u64) -> Self
pub fn from_env() -> Self
Sourcepub fn is_aborted(&self) -> bool
pub fn is_aborted(&self) -> bool
Check if the watchdog has aborted the stream
Sourcepub fn watchdog_fired_at(&self) -> Option<u128>
pub fn watchdog_fired_at(&self) -> Option<u128>
Get when the watchdog fired (for measuring abort propagation delay)
Sourcepub fn fire(&mut self) -> String
pub fn fire(&mut self) -> String
Mark the watchdog as having fired (called by the actual timeout logic). Returns the abort reason message.
Sourcepub fn warning_message(&self) -> String
pub fn warning_message(&self) -> String
Log warning when stream has been idle for half the timeout
Auto Trait Implementations§
impl Freeze for StreamWatchdog
impl RefUnwindSafe for StreamWatchdog
impl Send for StreamWatchdog
impl Sync for StreamWatchdog
impl Unpin for StreamWatchdog
impl UnsafeUnpin for StreamWatchdog
impl UnwindSafe for StreamWatchdog
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