-
Notifications
You must be signed in to change notification settings - Fork 10
Lazy broadcast channel #373
Copy link
Copy link
Closed
Labels
part:channelsAffects channels implementationAffects channels implementationpart:coreAffects the core types (`Sender`, `Receiver`, exceptions, etc.)Affects the core types (`Sender`, `Receiver`, exceptions, etc.)
Milestone
Metadata
Metadata
Assignees
Labels
part:channelsAffects channels implementationAffects channels implementationpart:coreAffects the core types (`Sender`, `Receiver`, exceptions, etc.)Affects the core types (`Sender`, `Receiver`, exceptions, etc.)
What's needed
Still need to come up with a new name for this broadcast channel configuration, but I think it would be nice to get broadcast channels that pause on overflowing receivers. (without blocking
sender.send)Receiver behaviour
When a receiver is not being consumed from for a certain duration, the channel stops sending to it. If the receiver is awaited again, it gets treated like a new receiver, starting with an empty buffer, and respecting
resend_latest.Sender behaviour
The
sendmethods don't block, so it is the same behaviour as now, but the sender has a property and an async method which can be used to prevent wasteful work, like this:This would prevent the sending side from doing active work, and possibly stop receiving from its upstream and stop work on that level as well.
So channels would finally transmit information about receivers to the sending side, if they are interested.