Deep dive into Kotlin Flow
summary
Covers concrete pitfalls and fixes for Kotlin Flow: explains that MutableStateFlow is non‑completable and conflates values, that channelFlow supports concurrent emissions, and that operator fusion can silently preserve an old dispatcher or buffer size causing overflow. Dives into transformLatest, sample, merge, and stateIn/sharingStarted implementations, warns that some upstreams may never complete (example exaggerated to “one year”), and shows testing recipes using Turbine, an unlimited-buffer channel as upstream, background scope instead of TestScope, and multi‑threaded dispatchers to catch races.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 3:58Flow basics and types
- 14:01Flow builders and fusion
- 20:31Custom operators
- 27:50Testing Kotlin Flow
- 34:42Summary








