You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... state Optional(dict[Unicode string, Any]) – An empty namespace where the application can persist state to be used when handling subsequent requests. Optional; if missing the server does not support this feature.
Describe the use case of this feature:
Lifespan state allows to share state between requests, such as a ML model in GPU or a connection to a database.
It is supported by other important ASGI servers such as uvicorn (ref: encode/uvicorn#1818)
However httpx is the recommended library to test FastAPI apps (AsyncClient) so we can't test such applications.
The text was updated successfully, but these errors were encountered:
Please describe your feature request:
Support ASGI's lifespan state: https://asgi.readthedocs.io/en/latest/specs/lifespan.html
Describe the use case of this feature:
Lifespan state allows to share state between requests, such as a ML model in GPU or a connection to a database.
It is supported by other important ASGI servers such as uvicorn (ref: encode/uvicorn#1818)
However
httpx
is the recommended library to test FastAPI apps (AsyncClient
) so we can't test such applications.The text was updated successfully, but these errors were encountered: