Module 16 Β· Concurrency Patterns β Lesson 2 of 4 Β· ~9 min
Fan-out / fan-in
Naming what you just built, and what's missing
The worker pool was already a fan-out: several goroutines all reading from one input channel, spreading the work across themselves. When three workers range over the same jobs channel, the Go runtime hands each job to whichever worker is free. That's fan-out β one source, many consumers.
The gap: those workers wrote into a shared results channel that main drained by counting to nine. That works, but it's brittle β main had to know the exact number of results. The general pattern gives each producer its own output channel and then merges them. Merging many channels into one is fan-in.