Marco Pierucci
03/19/2021, 9:56 PMprivate val _event = MutableSharedFlow<S>(extraBufferCapacity = 1)
val event: SharedFlow<S> get() = _event.asSharedFlow()
be a correct alternative to Channels
for single shots events? Or would events would still be dropped if there are no subscribersstreetsofboston
03/19/2021, 10:41 PMemit
will cause the event to be dropped.streetsofboston
03/19/2021, 10:43 PMn
subscribers:
subscriptionCount.first { it >= n }
emit(value)
Javier
03/20/2021, 1:36 AMMarco Pierucci
03/20/2021, 2:17 AMJavier
03/20/2021, 2:45 AMMarco Pierucci
03/20/2021, 2:53 AMWhat about the use of SharedFlow? Can that help? Unfortunately, no. SharedFlow is hot. This means that during periods where the is no observer, say during a configuration change, events emitted on to the flow are simply dropped. Regrettably, this also makes SharedFlow inappropriate to emit events on.
Marco Pierucci
03/20/2021, 2:53 AM