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

Enhancement: Async generated content in response body #2386

Open
geeshta opened this issue Sep 29, 2023 · 0 comments
Open

Enhancement: Async generated content in response body #2386

geeshta opened this issue Sep 29, 2023 · 0 comments
Labels
Enhancement This is a new feature or request Responses This is related to our Responses feature

Comments

@geeshta
Copy link
Contributor

geeshta commented Sep 29, 2023

Summary

I've added #2359 because it seemed like an easy enough change to implement but as @euri10 pointed out, it might not really bring much if anything.
However the conversation around it pointed out the issue that there isn't a good way to await response body content from async sources - which could be async generated templates like what Jinja supports or files read asynchronously.

@provinzkraut and @peterschutt suggested some solutions in the discussion from the PR so this issue proposes implementing the proper abstraction. So that async content can be served withou breaking separation of concerns and adding this logic to ASGIResponse classes. Maybe it could potentially help with #1250 ? Am not sure though. However if this gets through, #2359 could be reimplemented in a proper way.

Basic Example

No response

Drawbacks and Impact

No response

Unresolved questions

Is this even worth pursuing? Jinja rendering and file serving currently both work ok without this.


Funding

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@geeshta geeshta added the Enhancement This is a new feature or request label Sep 29, 2023
@geeshta geeshta mentioned this issue Oct 1, 2023
3 tasks
@JacobCoffee JacobCoffee added the Responses This is related to our Responses feature label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request Responses This is related to our Responses feature
Projects
Status: Ideas
Development

No branches or pull requests

2 participants