Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASGI lifespan state #1058

Closed
GuillaumeDesforges opened this issue Mar 26, 2023 · 2 comments
Closed

ASGI lifespan state #1058

GuillaumeDesforges opened this issue Mar 26, 2023 · 2 comments
Labels
Type: Enhancement Most issues will probably ask for additions or changes.

Comments

@GuillaumeDesforges
Copy link

Please describe your feature request:

Support ASGI's lifespan state: https://asgi.readthedocs.io/en/latest/specs/lifespan.html

Scope

...
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.

@GuillaumeDesforges GuillaumeDesforges added the Type: Enhancement Most issues will probably ask for additions or changes. label Mar 26, 2023
@AaronChen0
Copy link

This is a Go repository. What you want to request is this one, https://github.com/encode/httpx/ .

@GuillaumeDesforges
Copy link
Author

Oops. My bad! Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

No branches or pull requests

2 participants