Skip to content

Add Future::timeout #564

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

Closed
yoshuawuyts opened this issue Nov 20, 2019 · 6 comments
Closed

Add Future::timeout #564

yoshuawuyts opened this issue Nov 20, 2019 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@yoshuawuyts
Copy link
Contributor

Similar to future::timeout and Stream::timeout we should add a Future::timeout method.

We already have Future::delay, and timeout would be a great counterpart. This is similar to stdlib's max which is both an inherent method and a free function. Thanks!

@yoshuawuyts yoshuawuyts added good first issue Good for newcomers enhancement New feature or request labels Nov 20, 2019
@miker1423
Copy link
Contributor

I like to take this if no one is working on it.

@ghost
Copy link

ghost commented Nov 20, 2019

@miker1423 Go for it :)

@miker1423
Copy link
Contributor

Sorry for the absence.
As I understood, I should add a new extension method to the Future trait?

@miker1423
Copy link
Contributor

miker1423 commented Nov 23, 2019

Here is the implementation miker1423@c1f7be5, I know the docs are incomplete, I just wrote to take away the warning. Is this what was expected?

@yoshuawuyts
Copy link
Contributor Author

yoshuawuyts commented Nov 25, 2019

@miker1423 yeah that's in the right direction. I don't believe the pub modifiers are needed; pub(crate) should suffice. If you could submit the PR it'd make it easier to review. Thanks heaps for your work!

@miker1423
Copy link
Contributor

This should be closed with the merged PR #600, thanks!

@k-nasa k-nasa closed this as completed Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants