Enqueue a task at the appropriate tier.
(&mut self, task: ExecutionTask)
| 73 | |
| 74 | /// Enqueue a task at the appropriate tier. |
| 75 | pub fn push(&mut self, task: ExecutionTask) { |
| 76 | let queued = QueuedTask::new(task); |
| 77 | match queued.task.request.priority { |
| 78 | Priority::Critical => self.critical.push_back(queued), |
| 79 | Priority::High => self.high.push_back(queued), |
| 80 | Priority::Normal | Priority::Background => self.low.push_back(queued), |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | /// Total tasks across all tiers. |
| 85 | pub fn len(&self) -> usize { |
no outgoing calls