Fan-Out Fan-In Pattern — ELI5

Imagine you need to clean a really big house before a party. You could do it all yourself — vacuum every room, wash every dish, wipe every counter — but that would take forever. Instead, you call three friends. One vacuums, one does dishes, one wipes counters. They all work at the same time, and when everyone’s done, you look around and the whole house is clean.

That splitting up is “fan-out” — one big job becomes many small jobs running at the same time. The part where you check that everyone finished and the house is ready? That’s “fan-in” — gathering all the results back together.

Python programs do this all the time. Say you need to download 100 images from the internet. One at a time would be painfully slow. With fan-out, you start all 100 downloads at once (or in batches). With fan-in, you wait until all of them finish and then continue with the complete set.

It’s like a teacher handing out different problems to every student in class (fan-out), then collecting all the answer sheets and stapling them into one packet (fan-in).

The key idea: you don’t have to do everything yourself in order. Split the work, let others help, then combine the results.

One thing to remember: Fan-out is splitting one job into many parallel pieces. Fan-in is collecting all those pieces into one result. Together, they make big jobs feel small.

pythonconcurrencypatterns

See Also