Skip to content

Add Stream::timeout #340

Closed
Closed
@yoshuawuyts

Description

@yoshuawuyts

Similar to the future::timeout free function we should add a Stream::timeout method. This method should be marked as "unstable".

Example

// This example will never actually time out, but you get the idea.
let s = stream::repeat(1u8).take(100);
let s = s.timeout(Duration::from_secs(1));
while let Some(_) = s.next().await {
    dbg!();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions