Hi there, trying to work out why a mutableStateFlow.value can be set from outside of a coroutine, I assume it was essentially a wrapper for emit(). Could anyone help me understand what im missing?
Thanks, Michael
because it can be done without interaction with the subscribers. Basically there is no backpressure thanks to the conflation, so setting the value can always be done without suspending, and collectors are notified asynchronously because they check themselves for value updates. The implementation is not simple to be honest
Great thank you didn’t notice the conflation and this statement helps: a slow collector skips fast updates, but always collects the most recently emitted value