Drain incoming requests from the SPSC bridge into the priority queues. The number of requests drained per call is bounded by `spsc_read_depth`, which is reduced under Critical memory pressure and set to zero under Emergency. Each request is routed to the Critical, High, or Low tier based on `Request.priority`.
(&mut self)
| 17 | /// Emergency. Each request is routed to the Critical, High, or Low tier |
| 18 | /// based on `Request.priority`. |
| 19 | pub fn drain_requests(&mut self) { |
| 20 | if self.pressure_suspend_reads { |
| 21 | // Emergency pressure: do not accept new requests. |
| 22 | return; |
| 23 | } |
| 24 | let depth = self.spsc_read_depth.max(1); |
| 25 | let mut batch = Vec::new(); |
| 26 | self.request_rx.drain_into(&mut batch, depth); |
| 27 | for br in batch { |
| 28 | self.task_queue.push(ExecutionTask::new(br.inner)); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | /// Process the next pending task using the 8:4:2 priority drain ratio. |
| 33 | /// |