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

Add async request_timeout #177

Merged
merged 1 commit into from
Apr 29, 2021
Merged

Add async request_timeout #177

merged 1 commit into from
Apr 29, 2021

Conversation

erebe
Copy link
Contributor

@erebe erebe commented Apr 29, 2021

  • Add support for request_timeout in async nats

Why:

  • If we get disconnected from NATS for reason, as the lib use unblock() under the hood, the application will leak threads waiting for the operation to receive a reply that will never comeback.
  • Even if we get back the connection to NATS, those threads are lost in the limbo as they will never be able to receive a reply
  • Wrapping async request within a futures::timeout, works but does not kill the underlying threads used by unblock

What:

  • The PR exposes the request_timeout function in async-nats

@spacejam
Copy link
Contributor

spacejam commented Apr 29, 2021

LGTM, and thank you for updating the changelog and adding a new version! The tests are just failing on a clippy issue that I've already addressed on master.

@spacejam spacejam merged commit 5f676e7 into nats-io:master Apr 29, 2021
@spacejam
Copy link
Contributor

0.9.15 has been published which includes your change. Thanks again!

@erebe
Copy link
Contributor Author

erebe commented Apr 29, 2021

Thank you, good sir :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants