BroadcastChannels with non-zero capacity: are mess...
# coroutines
m
BroadcastChannels with non-zero capacity: are messages sent before anyone subscribes dropped? Or do they sit in the queue?
s
When a channel's queue is full, calling
send()
will suspend (calling
offer()
won't suspend, but drops instead).
m
Understood. I'm just curious if, with a BroadcastChannel, what happens to a message if nobody has called openSubscription(), so there are no receive channels created. Are the messages buffered and then released when somebody does call openSubscription()? Or are they just dropped?
l
Channels are always hot. Flow share operator is not there yet, there's an issue on GitHub for it.
z
ArrayBroadcastChannel
will drop anything sent to it when there are no subscribers.
ConflatedBroadcastChannel
will always cache the latest value sent to it, even if there are no subscribers.
👍 2