Is setting the value on a MutableStateFlow thread ...
# coroutines
k
Is setting the value on a MutableStateFlow thread safe?
yes black 3
a
It's documented.
All methods of state flow are thread-safe and can be safely invoked from concurrent coroutines without external synchronization.
k
That’s just
StateFlow
. I was wondering if doing
myMutableStateFlow.value = foo
is thread safe
a
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-mutable-state-flow/value.html
This property is thread-safe and can be safely updated from concurrent coroutines without external synchronization.
k
thanks. Big off. 🤦‍♂️
282 Views