Marcelo Trylesinski

@Kludex
59 Subscribers

Pinned & Latest Posts

View all
January 20
ยท
Premium
FastAPI Events

FastAPI Events

Today, we'll talk about the FastAPI events: "startup" and "shutdown".

The events are part of the [ASGI specification][asgi-specification], and they are called "lifespan" events.

Events

The "startup" event is triggered when the application starts.

Here's an example of a simple "startup" event:

```py from fastapi import FastAPI

app = FastAPI()

Subscriptions

View all

Support Kludex with a subscription & receive unique benefits in return

For Individuals

Supporter

$5/mo

Posts about packages I maintain, and are related to my work.

Premium posts