fix: don't starve high priority requests (#2660)

This commit is contained in:
Matthias Seitz
2023-05-13 19:18:24 +02:00
committed by GitHub
parent 99e6ee7a86
commit a5dbbe4187
2 changed files with 26 additions and 1 deletions

View File

@ -8,3 +8,15 @@ pub enum Priority {
/// Queued from the front for download requests.
High,
}
impl Priority {
/// Returns `true` if this is [Priority::High]
pub fn is_high(&self) -> bool {
matches!(self, Priority::High)
}
/// Returns `true` if this is [Priority::Normal]
pub fn is_normal(&self) -> bool {
matches!(self, Priority::Normal)
}
}