I wrote words about `BroadcastChannel.send()` and ...
# coroutines
t
I wrote words about
BroadcastChannel.send()
and then found the
offer()
which solved my problem. 🙂 I have a few questions about BroadcastChannel still. Old edited message follows I'm looking at using a
BroadcastChannel
to handle data from a webhook coming in. I have the multiple instances pulling from the channel as a
sharedWebhookChannel.asFlow().
From what I understand, it's a fan out type of primitive, all 3 flows see all the messages. If there are 3 flows collecting, and one is slow, then the channel will fill up. Followups: • I assume that means a slow subscriber would eventually fill the channel, leading to starvation of the faster 2. • pre-anyone subscribing, the messages are just dropped. If all the subscriptions are closed(via me canceling the flow collections), does the channel remain open and go back to the initial "drop it all on the floor" state? • If there ARE subscribers(and lets say there are X messages in the channel since one subscriber was slow), and a new subscriber appears, does his subscription to the channel start w/ the next new message, or does he see the messages that happen to be still in the channel due to the slow subscription. • Final: Is there anything that would operate where the Channel.send() would never suspend, but would remove the oldest element? Like a ringBufferChannel?