Get started in FastAPI, Starlette, and ASGI!
How do startup and shutdown events work in FastAPI, Starlette, and other ASGI applications? ASGI defines startup and shutdown events through the "lifespan" of an application, which it models as a connection between the server and the app. In this video we see the right way to do it in FastAPI, Starlette, and then understand the lifespan connection type in general, which we use to build our own lifespan handler from scratch that mimics what FastAPI does.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosS...
ASGI Spec: https://asgi.readthedocs.io/
App class video: • Async application classes vs. functions
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
/ mcoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted...
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Jameson, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: / discord
Github: https://github.com/mCodingLLC/
Reddit: / mcoding
Facebook: / james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:32 Startup in FastAPI
2:38 What to do at startup?
4:00 Lifespan connections in ASGI
8:10 Comparing against FastAPI
12:30 An important pro-tip
Watch video What you need to know about Startup and Shutdown Events in FastAPI and ASGI Applications online without registration, duration hours minute second in high quality. This video was added by user mCoding 13 May 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 12,033 once and liked it 698 people.