Skip to content

Document why we notify all streams when sending a single message #57

Open
@Ten0

Description

@Ten0

async-channel/src/lib.rs

Lines 204 to 208 in a0ba218

// it will notify another blocked receive operation.
self.channel.recv_ops.notify_additional(1);
// Notify all blocked streams.
self.channel.stream_ops.notify(usize::MAX);

It's unclear to me why all streams are woken up instead of a single one when sending a message. (That is, why don't streams and recv behave in the same way, when the stream is typically essentially "polling recv forever").

Would it be possible to document that further?

Thanks,

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