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

Add Async Support #193

Open
Archmonger opened this issue Feb 12, 2022 · 3 comments
Open

Add Async Support #193

Archmonger opened this issue Feb 12, 2022 · 3 comments
Assignees
Labels

Comments

@Archmonger
Copy link

Currently, the DownloadView operates as a sync view. It's very possible (and much more efficient) to do everything async.

File reading will have to be done via aiofile in order to not break the ASGI event queue though. After this change, Django versions will need to be limited to 3.1+

@Natim
Copy link
Collaborator

Natim commented Aug 4, 2022

Would you be interested to file a PR implementing this?

@Archmonger
Copy link
Author

Yes, but my time is spread a bit thin across the projects I currently support. It might take a while for me to get to this.

@Archmonger Archmonger self-assigned this Oct 19, 2022
@Archmonger
Copy link
Author

Archmonger commented Jul 5, 2023

Note: I have an in-progress PR for whitenoise which has an implementation of sending files via async in Django. The implementation in this repo would be heavily similar.

I believe Django supports async iterators within StreamingHttpResponse now. Async support within django-downloadview should be pretty simple to implement especially since I created a Django-compatible async file iterator in that whitenoise PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants