Register a pending request. Returns a bounded receiver the session awaits. For non-streaming requests, exactly one response arrives. For streaming requests, multiple partial responses arrive before the final one. Channel capacity applies backpressure when the session is slow.
(&self, id: RequestId)
| 51 | /// For streaming requests, multiple partial responses arrive before the final one. |
| 52 | /// Channel capacity applies backpressure when the session is slow. |
| 53 | pub fn register(&self, id: RequestId) -> mpsc::Receiver<Response> { |
| 54 | let (tx, rx) = mpsc::channel(REQUEST_CHANNEL_CAPACITY); |
| 55 | self.lock_pending().insert(id, tx); |
| 56 | rx |
| 57 | } |
| 58 | |
| 59 | /// Forward a response from the Data Plane to the waiting session. |
| 60 | /// |