kp-select
Installation
SKILL.md
One-line summary
A select { … } expression suspends on multiple suspending clauses (channel receives, deferred awaits, timeouts) at once and resumes when the first one becomes ready — coroutine-safe, biased toward declaration order.
When to use this skill
- Multiplexing across several channels: "wait for input from any of these sources".
- Racing several
Deferred<T>and acting on the first to finish (other branches naturally lose). - Implementing a timeout: select between the real operation and an
onTimeoutclause. - Building a non-blocking poll across channel state without locking up the calling coroutine.
When NOT to use this skill
- A single source —
await,receive, ordelaydirectly.selectadds ceremony for no benefit. - "Pick the latest" semantics on a
Flow→ useflatMapLatest, notselect. - Choosing between alternative algorithms (no timing involved) →
whenon a config flag.