Do I understand correctly that there is no way to ...
# coroutines
r
Do I understand correctly that there is no way to peek the last value from
ConflatedChannel
without removing it?
l
I guess you are right.
BroadcastChannel
and
ConflatedBroadcastChannel
have a
valueOrNull
and a `value`properties though
r
Good catch, thank you. I was already thinking that I may need
BroadcastChannel
in this specific place so that I can pull values in several places, and this finding confirms the decision.
Hmm. Was having the following in the other place:
Copy code
val connected: ReceiveChannel<Boolean>
    get() = connectedBroadcast.openSubscription()
private val connectedBroadcast = ConflatedBroadcastChannel<Boolean>()
This way I'm disallowing clients to modify underlying channel data. It seems that for just getting the
.value
I have to put additional public property. This is quickly becoming ridiculous 🙂 (I was already pointed at https://youtrack.jetbrains.com/issue/KT-14663 earlier)