Is there a way to share emitted value between consumers of the flow that's backed by the channel? Can't figure out a way for both consumers to get the same value. In attached test producer is playing ping pong between them. I hope SharedFlow will be released soon, but until it is, is there any other way? 😅
I think you should be able to use asFlow instead of this function. Then you don’t have the problem of closing.
👍 1
m
Maciek
07/23/2020, 11:43 AM
but now
BroadcastChannel
broke that producer produces only when there're subscribers, this is another requirement. Is there a way to have both, so shared value and a lazy producer?
m
molikuner
07/23/2020, 11:55 AM
I’m not sure whether that fixes your problem, but you could try to use send instead of offer.
m
Maciek
07/23/2020, 12:08 PM
unfortunetly it doesn't because BroadcastChannel is buffered or confloated so it won't suspend the call straight away