-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Currently when issuing a request (using ReqSocket) the future will resolve to the response.
This is most often useful, but it is not an atomic operation:
- The request is sent to the underlying driver (which is driven autonomously by the task)
- The response is received back in a channel
It would be useful therefore to expose this and allow users to ensure the request has been queued without having to necessarily retrieve a response back in the same future.
This, for example, could allow timing precisely how long a request has taken to process, or would allow the response to be received by another task.
The following pseudocode illustrates the desired behaviour:
let response_fut = req_socket.send_request(request).await?;
// somewhere else
let response = response_fut.await?;impl ReqSocket {
async fn send_request(&self, req: Request) -> ResponseFut {
let (tx, rx) = oneshot::channel();
self.to_driver.send(req).await?;
rx
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels