Skip to content

Suggestion: Spawn tasks on first poll #6

Open
@Thegaram

Description

@Thegaram

"A fundamental difference between Rust's futures and those from other languages is that Rust's futures do not do anything unless polled. " [0] I think following this behavior in this crate would make it more consistent with the rest of the ecosystem.

Current behavior: The snippet below keeps printing "called" indefinitely even though we did not await it.

crate::from_stream(async_std::stream::repeat(5usize))
        .for_each(|_| async { println!("called") });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions