elizarov
12/13/2017, 8:41 AMval connectionStatus = ConflatedBroadcastChannel<Boolean>(false)
to keep connected/disconnected status and then whenever I need to wait for it being connected I'd do connectionStatus.consume { while (!receive()) { /* do nothing */ } }
louiscad
12/13/2017, 9:07 AMreceive()
docs say calling it "removes from the channel", but this statement is false for `BroadcastChannel`s, right? Also, what does Conflated
means exactly?isLocked
property.elizarov
12/13/2017, 10:17 AMreceive()
removes from the channel, but here we are working with BroadcastChannel
, so each consumer opens its own channel that receives its own copy of the value that was sent.Conflated
means that it stores the most recently sent value, so if you start consuming, then the first thing that is receive it the last state that was sent.