#33699: Read ASGI request body from asyncio queue on-demand
-------------------------------+------------------------------------
     Reporter:  Noxx           |                    Owner:  noneNote
         Type:  New feature    |                   Status:  closed
    Component:  HTTP handling  |                  Version:  dev
     Severity:  Normal         |               Resolution:  wontfix
     Keywords:  ASGI, async    |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  1
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------
Comment (by Klaas van Schelven):

 TBH I'm not wholly convinced on your reading of the ASGI standard.

 1. The ellipsis in the quote from the first bullet read "the body message
 serves as a way to stream large incoming HTTP bodies in chunks", and it is
 not clear to me why there would be a "way to stream large incoming HTTP
 bodies" on the ASGI http protocol level if ASGI applications are forbidden
 to make use of this in a meaningful way.

 2. Regarding the second quote, first part "should wait" could be read as
 "should wait if the application needs the whole request body to make its
 response"

 3. Regarding the second quote, second part there is no need to read
 "should be processed" as "should be processed no earlier than"

 4. Your reading (correct or not) is in direct contradiction with the
 second paragraph of the ASGI spec which reads in full "ASGI attempts to
 preserve a simple application interface, **while providing an abstraction
 that allows for data to be sent and received at any time**, and from
 different application threads or processes." (emphasis mine)

 You say the ASGI spec cannot be changed, but AFAIU the links between the
 ASGI Team and the Django team are quite close, so this is not entirely
 impossible.

 As a final note: the 2 "other" big ASGI servers (not built by Andrew)
 actually have a "Hello World" example in their right on the homepage / in
 the quickstart that does in fact do no attempt to read the request (and
 are thus in violation of the spec as understood by Carlton):

 *
 
[uvicorn](https://github.com/encode/uvicorn/blob/c23cd24e6676ee0638d014d7000af1e6e0996bd6/README.md#L58)
 *
 
[hypercorn](https://github.com/pgjones/hypercorn/blob/84d06b8cf47798d2df7722273341e720ec0ea102/docs/tutorials/quickstart.rst#L14)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/33699#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190a3609a89-63ac875d-c8e9-4a57-88cf-52ca35dd5f06-000000%40eu-central-1.amazonses.com.

Reply via email to