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

use executor-agnostic timers #298

Closed
wants to merge 1 commit into from
Closed

Conversation

vhdirk
Copy link

@vhdirk vhdirk commented Mar 20, 2020

This PR replaces the tokio Timeout with a pure futures-based approach: race the request with a delay from the futures-timer crate.

I haven't extensively tested this, but for my minimal use case it seems to work.

Supersedes #296 and fixes #297

@tikue
Copy link
Collaborator

tikue commented Mar 20, 2020

Thank you! Things have been a bit crazy here but I'll try to get a review done this weekend.

@vorot93
Copy link
Contributor

vorot93 commented Mar 21, 2020

futures-timer tracks timers in its own thread which makes it a mini-runtime on its own. Therefore I am strongly opposed to merging this because this would mean much bigger overhead to placate a minority of users (tokio is used by more async prod than all other runtimes combined).

A better solution would be to generalize the timer behaviour, but doing that would be non-trivial.

@@ -28,6 +28,7 @@ travis-ci = { repository = "google/tarpc" }
[dependencies]
fnv = "1.0"
futures = "0.3"
futures-timer = "3.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've seen some issues come from this crate in the past just FYI. I would advise against using it.

@vorot93
Copy link
Contributor

vorot93 commented Mar 27, 2020

Yeah, I don't think that futures-timer is a desirable solution. Thanks for the effort though!

@vorot93 vorot93 closed this Mar 27, 2020
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.

Non-tokio executor & timeouts
4 participants