The event loop.
One waiter working a full restaurant by never standing still waiting, just taking the next ready task each time around.
- Just me today!1
One waiter runs the whole restaurant — many tables, one person to serve them.
- You first.2
So the rule is simple: take the next order that is ready, right now.
- Kitchen’s got it.3
Slow work like cooking is handed to the kitchen — the waiter does not stand and wait.
- 4
While it cooks, the waiter keeps serving everyone else, never standing idle.
- Order up — I’ll grab it.5
When the food is up, the waiter picks it up on a later trip around the room.
- Nobody move…6
The catch: one task that hogs the waiter freezes everyone — keep each task short.
Semicolony semicolony.dev/eli5/event-loop/comic