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!
I like to take this if no one is working on it.
@miker1423 Go for it :)
Sorry for the absence.
As I understood, I should add a new extension method to the Future trait?
Here is the implementation https://github.com/miker1423/async-std/commit/c1f7be5d42f9fbeb63250e2b4f75986d2ae94fec, I know the docs are incomplete, I just wrote to take away the warning. Is this what was expected?
@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!
This should be closed with the merged PR #600, thanks!
Most helpful comment
Sorry for the absence.
As I understood, I should add a new extension method to the Future trait?