How to use Lifespan events in synchronous fastapi

56 Views Asked by At

I want to use httpx for better performance in my Fastapi web server. I want to initiate it using the lifespan event as written in the docs or in this answer.

I'm using Fastapi as a synchronous server without the async functionality.

Does it matter? The asynccontextmanager fits both or only if I use Fastapi with async?

0

There are 0 best solutions below