-
Notifications
You must be signed in to change notification settings - Fork 107
[FeatureRequest] Add support for generator output #929
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
Comments
Hi @mockodin , Thank you for your feedback! Adding this issue as a feature request to consider this in future implementations. |
Has there been any progress on this? I am trying to use Fast API and Starlette to return large files via an HTTP trigger on functions, but the lack of ability to use streaming severely limits the usefulness of functions for such a task. |
I also want this functionality. Based on the current code structure, maybe the easiest way to implement this is to update downstream code handling func.HttpResponse to accept iterators that yield str/bytes. For the OP's specific use case, there is an easier implementation that requires very small change of code: mmap the video file as read only, and pass the mmap object to func.HttpResponse which is a bytearray-like object. @YunchuWang Can you please point me to the code of serving the response body to HTTP server? I might be able to submit a patch, beginning from: ` class HttpResponse(_abc.HttpResponse):
` |
sorry for late followup! thanks for all feedback. Recently function host started supporting http streaming and we have been working on supporting http streaming going to release early next year(jan-feb). Will post update once thats released, stay tuned! |
Addressed by HTTP Streaming. Please see this documentation for more information: |
azure.functions.HttpResponse currently supports only str/bytes content (body). This has a high memory overhead for delivery of large returns. Adding support for a generator would be ideally to support larger returns without the high memory consumption. This is commonly supported on other Response objects such as flask.Response
The text was updated successfully, but these errors were encountered: