Simon Stahl
04/27/2022, 9:04 PMMutableSharedFlow
as an app wide event bus for a reactive architecture. Does anything speak against it? Does it stay stable if the app is kept open all day long and is repeatedly put into foreground/background?Simon Stahl
04/27/2022, 10:20 PMAdam Powell
04/27/2022, 11:22 PMSimon Stahl
04/27/2022, 11:57 PMMutableSharedFlow
?Adam Powell
04/28/2022, 12:43 AMColton Idle
04/28/2022, 12:55 PMSimon Stahl
04/28/2022, 6:28 PMFlow
(backed by a MutableSharedFlow
). The question is if that flow stays stable over an extended period of time and several app backgrounds/foregrounds or if i had to resubscribe to itAdam Powell
04/29/2022, 2:26 AMMutableSharedFlow
isn't going to end since SharedFlow
never completesAdam Powell
04/29/2022, 2:27 AMkill -9
and the whole process is terminated, there's no cancellation or callback or graceful exit involvedAdam Powell
04/29/2022, 2:30 AMAdam Powell
04/29/2022, 2:32 AMflowWithLifecycle
operator in the androidx lifecycle libraries to stop collecting an upstream flow when a given Lifecycle
is stopped, which can be used to intentionally unsubscribe while some part of your app is in the background, but this won't happen out from under you. You have to opt-in by assembling those flow operators yourselfSimon Stahl
04/29/2022, 8:02 PM