kp-dispatchers

Installation
SKILL.md

One-line summary

Pick a dispatcher whose thread-pool characteristics match the work — Default for CPU-bound, IO for blocking I/O, Main for UI updates, Unconfined only when you really mean "stay on whatever thread called me".

When to use this skill

  • Designing a suspending function whose work has specific concurrency characteristics (CPU-heavy, blocking I/O, UI-bound).
  • Code that mixes blocking calls with coroutines and risks starving a thread pool.
  • Switching dispatchers mid-computation with withContext.
  • Code review wants to verify dispatcher choices are deliberate.

When NOT to use this skill

  • The work is a single suspend call to another suspend function — usually no dispatcher choice needed.
  • The code already runs in a dispatcher-aware framework primitive (viewModelScope defaults to Main.immediate).

Core content

Dispatchers.Default — a thread pool sized for CPU cores (typically max(2, #cores)). Use for CPU-bound computation (parsing, transformation, mathematical work). Saturating it is OK — those threads are the right size for the machine.

Installs
1
GitHub Stars
1
First Seen
Jul 13, 2026
kp-dispatchers — yonatankarp/software-design-skills