async-std icon indicating copy to clipboard operation
async-std copied to clipboard

Clarify StreamExt::timeout() docs

Open Seeker14491 opened this issue 5 years ago • 0 comments

The description for StreamExt::timeout() states it will "await a stream or times out after a duration of time," but it's not clear whether it times out after the specified duration

  1. since calling timeout()

or

  1. since a stream item was last produced

I wanted #2 when I used this function, but then I realized it actually works like #1.

I noticed theres a pull request that adds a timeout_repeat() function that implements #2; the docs on both these functions should make it clear which of the above behaviors it implements.

Seeker14491 avatar May 28 '20 17:05 Seeker14491