The event loop
So let's say you gave your minion this list of tasks:
- take out the rubbish
- get the shopping
- clean the house
- mow the lawn
The first thing your minion does is go to the terminal and press the button to print off the first task - to take out the rubbish. Your minion reads the task and then proceeds to go and get the rubbish and take it down to the dock where it'll get picked up later by a rubbish boat.
Once he's done this he has nothing to do so he goes back to the terminal, presses the button and gets another task - to get the shopping. He reads the new task, goes into the house and compiles a list of required shopping. He then takes it down to the dock and puts the list into a box where it'll be picked up and later on the shopping will be delivered to the dock. At this point, once the list is delivered to the box, your minion has nothing to do.
So, he goes back to the terminal and prints another task. This time he needs to clean the house, easy enough, he goes off and cleans the house. Once he's done he comes back to the terminal and prints another task. While he was cleaning the house the shopping was delivered to the dock and a new task was added to the list - to collect the shopping and unpack it. But when he prints the next task it says to mow the lawn, in this case there's an automatic lawn mower. So he goes and sets the lawn mower going. Then, as he has nothing to do, goes back to the terminal and presses the button.
The task is to get the shopping so he heads down to the dock to collect the shopping and unpack it. While he's doing this the lawn mower finishes and needs to be put away. This creates a new task on the terminal - to put the lawn mower away. When your minion goes back to the terminal he picks up the task to put the lawn mower away, which, he does.
In this analogy the terminal is the event loop, your minion is the main thread and the lawnmower or shopper at the dock are asynchronous I/O operations. So you could replace the shopper with a http request and the lawnmower with disk I/O.