REST API
From processes to web services
REST API — Section Overview
The title of this section is a bit of a misnomer—on purpose. We will get to REST APIs, but first we need to build up the machinery that makes them work. That means understanding processes, threads, interprocess communication, and networking fundamentals. Only then does the notion of a “client talking to a server over HTTP” really make sense.
Think of it as a journey from the bottom of the stack to the top.
Concurrency Foundations (Lectures 1–2)
We start by understanding how operating systems run multiple programs at once, and how Python can participate.
- Lecture 1: Introduction to Processes and Threads — What processes and threads are, how to explore them with
psutil, launch them withsubprocessandmultiprocessing, and coordinate them with synchronization primitives. - Lecture 2: Multiprocessing and Multithreading in Practice — Combining threads and processes in a real application: a TKinter GUI that spawns worker processes to approximate π with live visual feedback.
Communication and Networking (Lecture 3)
Once we have multiple processes, we need them to talk to each other.
- Lecture 3: Interprocess Communication and Sockets — IPC mechanisms, raw sockets, TCP vs UDP, and building a simple ping/pong between two processes.
Client-Server and the Web (Lectures 4–5)
With networking in hand, we zoom in on the dominant pattern of the modern web.
- Lecture 4: Client-Server Architectures and RESTful APIs — The ideas behind client-server, RPC vs REST, what makes an API truly RESTful, and why “REST” is one of the most misused terms in software.
- Lecture 5: Async Programming, Event Loops, and ASGI — The thread-per-client problem,
async/awaitin Python, and how frameworks like FastAPI and servers like Uvicorn fit together.
Ready? Start with Lecture 1: Introduction to Processes and Threads.