What’s the equivalent of a UnicastSubject in Flow?...
# coroutines
a
What’s the equivalent of a UnicastSubject in Flow? SharedFlow with a buffer suspend might mimic emission behaviour however what about ensuring emissions aren’t missed if there are no collectors?
j
I'm not an Rx expert, but from what I read from the docs of UnicastSubject it looks like a
Channel
with unlimited buffer +
.consumeAsFlow()
is what you're looking for. The emitter can
send
to this channel, and the (single) receiver views it as a flow
☝️ 1
👍 1