nats.rs icon indicating copy to clipboard operation
nats.rs copied to clipboard

Break apart request and response

Open caspervonb opened this issue 11 months ago • 0 comments

Use case

In some cases, you may want to shoot off a bunch of requests and defer processing the responses til later.

Proposed change

Introduce a Response<T = Message> type, this type would either be a future or into_future.

let response = client.request(...).await?; // Waits for the completion of the send.
let message = response.await?; // Waits for the receiving channel to get a message

Who benefits from the change(s)?

Users wanting to not wait for responses immediately

Alternative Approaches

No response

caspervonb avatar Aug 03 '23 04:08 caspervonb