--

I'm not quite sure I follow but I suspect you're see the channel's fan out effect: https://kotlinlang.org/docs/channels.html#fan-out

Normally events are considered single target since they are usually meant to be processed once and once only. Your use case sounds more like a "broadcast" where it might be appropriate to use sharedflow since you want to process the data more than once. You do run the risk of dropping an emission from the shared flow if both subscribers aren't active at the same time though. Without knowing more its hard to know what a solution is.

--

--

Michael Ferguson
Michael Ferguson

Written by Michael Ferguson

Android software developer. Views and opinions expressed are my own and not that of my employer.

No responses yet