Francisco
06/15/2021, 4:35 AMConflation
in case one of the collector is being to slow
• flow is generated once (meaning I don't want to compute each item in the flow twice)
I was able to do this using broadcast channel and consuming it as channel like openSubscription().consumeAsFlow().conflate()
. Is is possible to do something similar to this using flows? Thanks!Francisco
06/15/2021, 5:47 AMdarkmoon_uk
06/15/2021, 8:00 AMSharedFlow
with replay = 1
fits those requirements.darkmoon_uk
06/15/2021, 8:00 AMFlow
look at the .shareIn
operatordarkmoon_uk
06/15/2021, 8:09 AMStateFlow
against your use case; this is similar to a SharedFlow
but always holds a current, intrinsic value.Francisco
06/15/2021, 4:05 PMFrancisco
06/15/2021, 4:31 PMSharedFlow vs BroadcastChannel
are great!