What you need to know about Startup and Shutdown Events in FastAPI and ASGI Applications

Опубликовано: 13 Май 2024
на канале: mCoding
12,033
698

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


Смотрите видео What you need to know about Startup and Shutdown Events in FastAPI and ASGI Applications онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь mCoding 13 Май 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 12,033 раз и оно понравилось 698 людям.