kp-channels

Installation
SKILL.md

One-line summary

A Channel<T> is a coroutine-safe queue used for message-passing between coroutines — the building block for pipelines, fan-out / fan-in, and any coordination that can't be expressed with Flow or shared state alone.

When to use this skill

  • Multiple producer coroutines or multiple consumer coroutines that need to coordinate on a stream of values.
  • Building a pipeline: stage A produces; stage B transforms; stage C writes. Each stage is its own coroutine connected by channels.
  • Fan-out: one producer, many workers (load distribution).
  • Fan-in: many producers, one consumer (collecting results).
  • When Flow is too constrained — Flow is single-collector-cold; Channel lets multiple coroutines compete for elements.

When NOT to use this skill

  • A single producer and a single consumer with no buffering needs → just use a Flow (cold) or suspend fun.
  • Sharing observable state with multiple subscribers → StateFlow / SharedFlow (see kp-flow-cold-vs-hot).
  • Pure transformations on a stream → Flow operators (see kp-flow-operators).
  • Coordination between threads in non-coroutine code → use a java.util.concurrent queue.
Installs
1
GitHub Stars
1
First Seen
Jul 13, 2026
kp-channels — yonatankarp/software-design-skills