kotlin-coroutines-flows
Kotlin Coroutines and Flow patterns for Android and KMP — structured concurrency, Flow operators, StateFlow, error handling, and testing. Use when writing coroutines or Flow code on Android or KMP, or debugging cancellation and concurrency.
Target: Mobile development. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original English text
Topics in the source
- Kotlin Coroutines & Flows
- When to Activate
- Structured Concurrency
- Scope Hierarchy
- Parallel Decomposition
- SupervisorScope
- Flow Patterns
- Cold Flow — One-Shot to Stream Conversion
Patterns for structured concurrency, Flow-based reactive streams, and coroutine testing in Android and Kotlin Multiplatform projects. Writing async code with Kotlin coroutines Using Flow, StateFlow, or SharedFlow for reactive data Handling concurrent operations (parallel loading, debounce, retry) Testing coroutines and Flows Managing coroutine scopes and cancellation Always use structured concurrency — never GlobalScope: Use coroutineScope + async for parallel work: Use supervisorScope when child failures should not cancel siblings: WhileSubscribed(5000) keeps the upstream active for 5 seconds after the last subscriber leaves — survives configuration changes without restarting. In KMP, use Dispatchers.Default and Dispatchers.Main (available on all platforms). Dispatchers.IO is JVM/Android only — use Dispatchers.Default on other platforms or provide via DI. Long-running loops must check for cancellation: Using GlobalScope — leaks coroutines, no structured cancellation Collecting Flows in init {} without a scope — use viewModelScope.launch Using MutableStateFlow with mutable collections — always use immutable copies: state.update { it.copy(list = it.list + newItem) } Catching Cancell
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- pi/core/skills/kotlin-coroutines-flows/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.055Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.