Try to receive a response from the Data Plane. On success, signals the producer wake eventfd so the TPC core knows there's space for more responses.
(&mut self)
| 153 | /// On success, signals the producer wake eventfd so the TPC core knows |
| 154 | /// there's space for more responses. |
| 155 | pub fn try_recv_response(&mut self) -> Result<Rsp> { |
| 156 | let result = self.consumer.try_pop(); |
| 157 | |
| 158 | if result.is_ok() { |
| 159 | // Signal the Data Plane that response queue has space. |
| 160 | let _ = self.rsp_wake.producer_wake.notify(); |
| 161 | } |
| 162 | |
| 163 | result |
| 164 | } |
| 165 | |
| 166 | /// Drain up to `max` responses into the buffer. |
| 167 | pub fn drain_responses(&mut self, buf: &mut Vec<Rsp>, max: usize) -> usize { |