So... For those who don't know me... I work fully remote, and every day I go to this coffee place that is around 5 minutes bike from my home. And... I asked the barista that works there to go out. We went out, and at some point I told her that "I do Open Source". I explained what open source is... - "I'm kind a communist on the code world." - "People contribute to public projects." - "Everybody use these makes use of those projects." Then I tried to explain specifically what I do in a nice way... I started with: "Yeah, you know... I kind a build the tools that people use to build real stuff" She was a bit confused, and said "I understand, I guess." I don't think she did. We are not going out anymore. Not for those reasons, but... Talking to her gave me the idea for this talk. It made me think about how can I explain in a nice way what I really know to others. Also, this is a subject that really excites me, since it touches a lot of packages in the ecosystem. Besides, I've only met nice people from India. So I dedicated a bit more of myself to this. Hope you enjoy this talk, as much as I enjoy your company.
Talk about Uvicorn (web server), FastAPI (web framework), and the client.
An image of Uvicorn. Also, explain what Uvicorn is.
Uvicorn is a server implementation that runs applications that look like FastAPI.
At the first moment, a 3-way TCP handshake is established, and then maybe a TLS handshake as well.
When I say the server, here I'll always mean Uvicorn.
Creates an object for that connection.
Show the uvicorn code
Explain that TCP handshake, and TLS handshake happens.
The request will be received by the task.
Show a picture of: Request line + Headers + CR line + body
- Request line (method, path, query) - HTTP headers
It's just to create the scope. See how the scope looks like.
Meaning it can be upgraded to WebSockets. Then the WebSocket scope will be created.
Show the `run_asgi` method in Uvicorn.
Each request means that the application is ran. Meaning that `FastAPI().__call__` is called.
Asynchronous Server Gateway Interface
It's the WSGI successor. But... I don't know much about WSGI. I don't have many years of experience.
Depends on the keep alive timeout.
Is there time to talk about it?
Is it even worth it?
Help on issues!
Watch your favorite packages on GitHub.
Things don't happen overnight. It takes time to get really good at something. Be patient.