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

Timeout for stream #1901

Closed
Riateche opened this issue Dec 5, 2019 · 5 comments
Closed

Timeout for stream #1901

Riateche opened this issue Dec 5, 2019 · 5 comments
Labels
A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. C-proposal Category: a proposal and request for comments M-stream Module: tokio/stream M-time Module: tokio/time

Comments

@Riateche
Copy link
Contributor

Riateche commented Dec 5, 2019

Version

0.2.2

Description

In PR #1774, the implementation of Stream for Timeout was removed, and the new constructor function (timeout) has a T: Future bound. Is there a way to create a stream with timeout now?

@carllerche
Copy link
Member

We should add one back. Probably via time::timeout_stream or something. I think a separate fn would be clearer.

tesaguri added a commit to tesaguri/twitter-stream-rs that referenced this issue Dec 18, 2019
@carllerche carllerche added C-enhancement Category: A PR with an enhancement or bugfix. E-help-wanted Call for participation: Help is requested to fix this issue. C-proposal Category: a proposal and request for comments labels Dec 21, 2019
@carllerche
Copy link
Member

Alternatively, we could do StreamExt::timeout(self).

@carllerche
Copy link
Member

Given that we have StreamExt we probably want to add a timeout fn on that.

@kamek-pf
Copy link

What workaround would you recommend in the meantime ?
I assume manually implementing Stream on a wrapper type and using Delay would work (?), or is there something simpler ?

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-stream Module: tokio/stream M-time Module: tokio/time labels Apr 20, 2020
@taiki-e
Copy link
Member

taiki-e commented Oct 5, 2020

Closing -- StreamExt::timeout is added in #2149

@taiki-e taiki-e closed this as completed Oct 5, 2020
@Darksonn Darksonn removed the E-help-wanted Call for participation: Help is requested to fix this issue. label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. C-proposal Category: a proposal and request for comments M-stream Module: tokio/stream M-time Module: tokio/time
Projects
None yet
Development

No branches or pull requests

5 participants