> android-concurrency

Standards for Coroutines, Flow, and Threading. Use when working with async operations, Coroutines, or Flow in Android. (triggers: **/*.kt, suspend, viewModelScope, lifecycleScope, Flow)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/android-concurrency?format=md"
SKILL.mdandroid-concurrency

Android Concurrency Standards

Priority: P0

Implementation Guidelines

Structured Concurrency

  • Scopes: Always use viewModelScope (VM) or lifecycleScope (Activity/Fragment).
  • Dispatchers: INJECT Dispatchers (DispatcherProvider) for testability. Do not hardcode Dispatchers.IO.

Flow usage

  • Cold Streams: Use Flow for data streams.
  • Hot Streams: Use StateFlow (State) or SharedFlow (Events).
  • Collection: Use collectAsStateWithLifecycle() (Compose) or repeatOnLifecycle (Views).

Anti-Patterns

  • GlobalScope: **No GlobalScope**: Use structured scopes.
  • Async/Await: **Avoid Async**: Prefer simple suspend functions unless parallel execution is needed.

References

┌ stats

installs/wk0
░░░░░░░░░░
github stars341
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────