<@U1ZQ36CJD> have you tried `ConflatedBroadcastCha...
# coroutines
e
@spierce7 have you tried
ConflatedBroadcastChannel
for broadcasting?
s
My understanding was that
ConflatedBroadcastChannel
is similar to an
AsyncSubject
. What if I wanted something similar to a
PublishSubject
?
e
Not sure what
PublishSubject
actually does, but in
ConflatedBroadcastChannel
when you publish messages and there are no subscribers, these messages will be lost. Subscribers will get only messages that were posted after their subscription
s
Oh? That sounds like a
PublishSubject
then.
e
Just give it a try 🙂
d
PublishSubject
==
BroadcastChannel(0)
,
BehaviorSubject
==
ConflatedBroadcastChannel
(which has a buffer of one, which is the latest value of the channel, but there's an open pull request to make this even better...)
👍 2
As far as I remember of Rx, since I dumped it for a while now because of coroutines...
s
oh? Maybe I'm misunderstanding the way channels work then.
d
The pull request is here https://github.com/Kotlin/kotlinx.coroutines/pull/274 , this pull is becoming more like a BehaviorRelay