#36281: ASGIHandler perfoms sync writes when reading the chunks of a HTTP
response's body
--------------------------------------+------------------------------------
Reporter: Brian Atkinson | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: asgi async | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Carlton Gibson):
That's a good one. Yes. A consideration for being careful about allowed
body sizes under ASGI. It'd be interesting to see what other ASGI
frameworks do here.
> …use a 3rd party library like asynctempfile (unclear whether this is
currently maintained)…
It looks small and depends on [
https://pypi.org/project/aiofiles/
aiofiles] which is a package I'd trust. It could likely be vendored if
needed, perhaps using the async version if `aiofiles` was available.
(I'd have to think through the severity of the blocking I/O to say whether
using such would be recommended or even required. We already mention
`aiofiles` in the docs, e.g. FileResponses.)
--
Ticket URL: <
https://code.djangoproject.com/ticket/36281#comment:4>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.