use std::time::Duration;
const QUIET_WINDOW_MS_DEFAULT: u64 = 750;
pub(super) const QUIESCENCE_TIMEOUT_MS_DEFAULT: u64 = 30_000;
#[derive(Clone, Copy, Debug)]
pub(in crate::relay) struct QuiescenceOptions {
pub quiet_window: Duration,
pub quiescence_timeout: Option<Duration>,
}
impl QuiescenceOptions {
pub(in crate::relay) fn for_async(quiet_window_ms: Option<u64>) -> Self {
Self {
quiet_window: Duration::from_millis(
quiet_window_ms
.filter(|value| *value > 0)
.unwrap_or(QUIET_WINDOW_MS_DEFAULT),
),
quiescence_timeout: None,
}
}
}