-
Notifications
You must be signed in to change notification settings - Fork 213
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
Proposal: "http.response.sendfile" extension. #184
Comments
Yes, I can see this being sensible, since having it as an extension means that things not on (a new enough) asyncio can just not provide it. |
Can I submit a PR to add this section to the ASGI document? |
Totally - I think it's best to iterate on a draft here, so we can make sure the specification is nailed down properly. |
Okay. |
It seems like this isn't (directly) related to The extension should make it clear that these aren't the same. Or maybe it would be possible to accommodate them along with allowing the ASGI server to use |
Yeah, we need to make this very clear in terms of what it does and allows. Maybe a rename to make it clearer - something like |
All right. If the name isn't clear enough, we can consider using zero-copy. That's what this extension is all about. What do you think? |
I'd be OK with |
I agree. @andrewgodwin |
Hi, I'm trying to implement this extension in hypercorn, but hava some question about it. The document said file is an integer, while |
The standard uses integer (file descriptor) to make it easier for servers written in C, Rust, and so on to handle this. |
@synodriver Maybe the PR encode/uvicorn#1210 can help you. |
Add the sendfile extension to allow ASGI programs to return response through
sendfile
.In
scope
:Response:
Some related links:
https://docs.python.org/3.7/library/asyncio-eventloop.html#asyncio.loop.sendfile
encode/uvicorn#35
The text was updated successfully, but these errors were encountered: