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 Future::timeout #564

Open
yoshuawuyts opened this issue Nov 20, 2019 · 5 comments

Comments

@yoshuawuyts
Copy link
Member

@yoshuawuyts yoshuawuyts commented Nov 20, 2019

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!

@miker1423

This comment has been minimized.

Copy link

@miker1423 miker1423 commented Nov 20, 2019

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

@stjepang

This comment has been minimized.

Copy link
Member

@stjepang stjepang commented Nov 20, 2019

@miker1423 Go for it :)

@miker1423

This comment has been minimized.

Copy link

@miker1423 miker1423 commented Nov 22, 2019

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

@miker1423

This comment has been minimized.

Copy link

@miker1423 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

This comment has been minimized.

Copy link
Member Author

@yoshuawuyts 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.