Kotlin Coroutine Flow: SharedFlow & StateFlow
Kotlin coroutine flow includes cold flow and hot flow. SharedFlow and StateFlow are two of the hot flows. They can broadcast values to several receivers, so can be used to implement the publisher-subscriber pattern.