use std::time::Duration;
#[derive(Debug, Clone)]
pub enum MkBackpressure {
Wait,
Fail,
Timeout(Duration),
Evict,
}
impl Default for MkBackpressure {
fn default() -> Self {
Self::Wait
}
}
impl MkBackpressure {
pub fn timeout(duration: Duration) -> Self {
Self::Timeout(duration)
}
pub fn timeout_ms(ms: u64) -> Self {
Self::Timeout(Duration::from_millis(ms))
}
}