Skip to content

Instantly share code, notes, and snippets.

@perrygeo
perrygeo / asyncio-intro.md
Created November 9, 2020 14:55
Basic intro to asyncio

Baking a cake: Why we need asyncronous code in Python

This is a basic analogy that explains why we need asyncio. Consider the process of baking a cake:

Before you bake a cake, you need to preheat the oven

def preheat_oven(target_temp):
    temp = 100
    while temp < target_temp: