kotlin-coroutines-flows

Implement structured concurrency and reactive streams with Kotlin coroutines and Flow.

6|1|Updated Nov 22, 2025
One-click install
npx skills add https://github.com/hightemp/proxy_switcher --skill kotlin-coroutines-flows-hightemp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/hightemp/proxy_switcher/tree/main/.agents/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/hightemp/proxy_switcher --skill kotlin-coroutines-flows-hightemp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin Coroutines & Flows guide that helps engineers implement reliable asynchronous code across Android and Kotlin Multiplatform projects, covering structured concurrency and reactive streams.

Core Features & Use Cases

  • Structured concurrency patterns (viewModelScope, coroutineScope, supervisorScope) for safe lifecycle-bound execution.
  • Flow-based data pipelines using Flow, StateFlow, and SharedFlow for reactive UIs.
  • Testing and debugging techniques for coroutines and flows, including test dispatchers and deterministic execution.

Quick Start

Create a small coroutine-based data loader in a ViewModel that collects results via StateFlow.

Frequently Asked Questions about kotlin-coroutines-flows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured concurrency in Kotlin Multiplatform projects?

Structured concurrency in Kotlin Multiplatform is implemented using coroutineScope and supervisorScope to bind asynchronous execution to specific lifecycles. This ensures responsive UIs and safe data pipelines by automatically canceling child coroutines when their parent scope closes.

What is the best way to build reactive UIs in Android using StateFlow?

Building reactive UIs in Android with StateFlow involves creating Flow-based data pipelines that emit state updates to the UI. You collect these values within lifecycle-aware scopes like viewModelScope to ensure responsive, robust asynchronous workflows.

How do I test Kotlin coroutines and flows with deterministic execution?

Testing Kotlin coroutines and flows requires using test dispatchers to achieve deterministic execution. This technique controls virtual time and dispatchers, allowing you to verify asynchronous workflows and data pipelines reliably without flaky behavior.

Can I use Kotlin coroutines and Flow for both Android and Kotlin Multiplatform?

Yes, you can use Kotlin coroutines and Flow across both Android and Kotlin Multiplatform projects. They provide structured concurrency and reactive streams to build robust, responsive UIs and data pipelines sharing logic across platforms.

How do I handle errors in Kotlin Flow data pipelines?

Handling errors in Kotlin Flow data pipelines involves applying structured concurrency patterns and supervisorScope to manage exceptions safely. This ensures robust asynchronous workflows by isolating failures and preventing them from canceling unrelated operations.