Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Broadcast channels to block senders when a receiver is not consuming #20

Open
sahas-subramanian-frequenz opened this issue Oct 14, 2022 · 1 comment
Labels
part:channels Affects channels implementation type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@sahas-subramanian-frequenz
Copy link
Contributor

What's needed?

When a broadcast receiver is not getting consumed from fast enough and its buffer has filled up, as new messages arrive, older messages in the receiver's buffer start to get dropped.

In some cases, we might not want messages to get discarded, and instead want the sender to wait for the receiver to drain before it can send further messages to the channel.

Proposed solution

Add an optional block_on_full boolean parameter to the get_sender method of the Broadcast channel, which defaults to False.

When true, calls to the send async method will not complete until the value has been sent to all the channels.

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

@sahas-subramanian-frequenz sahas-subramanian-frequenz added part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users labels Oct 14, 2022
@leandro-lucarella-frequenz leandro-lucarella-frequenz changed the title Allow Broadcast channels to block senders when a receiver is not consuming. Allow Broadcast channels to block senders when a receiver is not consuming Nov 2, 2022
@leandro-lucarella-frequenz leandro-lucarella-frequenz added part:channels Affects channels implementation and removed part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed labels Nov 2, 2022
@llucax
Copy link
Contributor

llucax commented Aug 7, 2023

This is related to #76, for sends that we know they can't block (because a buffer is used to store it and the message will be dropped if the buffer is full), there is no need to make it async, which has a performance impact. We could make async only sends that can block.

@llucax llucax added this to the v1.1.0 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:channels Affects channels implementation type:enhancement New feature or enhancement visitble to users
Projects
Status: To do
Development

No branches or pull requests

3 participants