-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: Streaming without callbacks #1647
Comments
I actually had a similar idea, back when I re-implemented the streaming response type in its current form. |
One thing that I am wondering is whether using asyncgen here would lead to issues with connection timeouts or with clean server shutdowns. From my experience with asyncio socket programming, everything just breaks in innumerable unexpected ways, especially when you do anything in the slightest unconventional. |
I agree that this is worthwhile to explore. |
Thanks for the feedback! The current implementation is hackish (implemented with minimal amount of code) but since you like the concept, I'll look closer into it. What comes to asyncgens, I can confidently say that with Trio they pose no issues. With asyncio-- well, more testing is necessary. |
As mentioned in #1661, the experimentation continues. I believe that a simple Currently open questions:
|
A quick update: respond is no longer async, so you can do simply I'll be in movie shoots and away from keyboard until next Friday. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
Still relevant, although I won't be able to do much about this right now. |
What do you think on using yield to acquire a response object for streaming? In addition to no-callback pure async code, this would also be extensible to HTTP/2 Server Push, where multiple responses may be sent from one request.
There is a proof of concept pull request #1645.
The text was updated successfully, but these errors were encountered: