Poll responses from all Data Plane cores.
(&mut self)
| 439 | |
| 440 | /// Poll responses from all Data Plane cores. |
| 441 | pub fn poll_responses(&mut self) -> Vec<envelope::Response> { |
| 442 | let mut responses = Vec::new(); |
| 443 | for channel in &mut self.cores { |
| 444 | let mut batch = Vec::new(); |
| 445 | channel.response_rx.drain_into(&mut batch, 64); |
| 446 | for br in batch { |
| 447 | let rid = br.inner.request_id.as_u64(); |
| 448 | if let Some(tid) = self.request_tenant.remove(&rid) |
| 449 | && let Some(count) = self.tenant_inflight.get_mut(&tid) |
| 450 | { |
| 451 | *count = count.saturating_sub(1); |
| 452 | } |
| 453 | responses.push(br.inner); |
| 454 | } |
| 455 | // Opportunistically flush WFQ after draining responses to fill headroom. |
| 456 | channel.flush_wfq(); |
| 457 | } |
| 458 | responses |
| 459 | } |
| 460 | |
| 461 | /// Number of Data Plane cores. |
| 462 | pub fn num_cores(&self) -> usize { |