mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix: don't starve high priority requests (#2660)
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user