Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppport for timeout in NatsClient.request method. #23

Open
thedodd opened this issue Feb 7, 2019 · 1 comment
Open

Suppport for timeout in NatsClient.request method. #23

thedodd opened this issue Feb 7, 2019 · 1 comment

Comments

@thedodd
Copy link

thedodd commented Feb 7, 2019

As described in the Nats FAQ here, it is assumed that users should be able to specify timeouts when making requests (request/response pattern).

We can use tokio's timeout system to accomplish this fairly easily. End users could do this on their own, but it would be awesome to be able to encapsulate this functionality as an Option<Duration> arg to the methods to which this would apply.

How do you guys feel about this? I am happy to write the code for it. Should be dead simple. Literally just wrapping the future in a timeout if a delay is given, else the code stays the same.

Thoughts?

@OtaK
Copy link
Contributor

OtaK commented Feb 21, 2019

Would be super cool indeed!

We are using requests timeouts in prod, but since nitox is wrapped by actix-nats and we use the timeouts provided by actix, the leaf future allows us to cancel the whole future altogether, I didn't think of adding the feature to nitox itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants