Hi Aymeric & Anssi,

Thanks for your feedback. I have updated my branch with an implementation 
of a new `HttpStreamingResponse` class plus tests and updated the ticket. 
Please take a look and let me know if this is moving in the right 
direction, and if there is any other feedback. If the approach is OK, I 
will add docs as well.

https://code.djangoproject.com/ticket/7581#comment:32
https://github.com/thirstydigital/django/tree/tickets/7581-streaming-response-middleware

Thanks.
Tai.


On Sunday, 26 August 2012 06:22:02 UTC+10, Aymeric Augustin wrote:
>
> Hi Tai, 
>
> Thanks for your work and sorry for the late answer. I just had the time to 
> review the discussion. 
>
>
> In my opinion, option 2 is reasonable. I'm -0 on a stream_content keyword 
> argument for HttpResponse. I +1 on adding a separate HttpStreamingResponse 
> class, because it better reflects the difference in behavior, and because 
> it makes it possible to define a different API from the regular 
> HttpResponse (for instance, we can chose not to define response.content). 
>  Then we can use a deprecation path to remove support for streaming 
> responses in the regular HttpResponse class. 
>
> Once the deprecation path completes, I expect that: 
> - HttpResponse will be simpler and more predictable (as it'll no longer 
> contain code to support streaming) 
> - both HttpResponse and HttpStreamingResponse will have intuitive and 
> well-behaved APIs (which isn't true right now) 
> - the implementations will be easier to understand and to maintain — 
> HttpResponse was one of the hardest classes to port to Python 3, so much 
> that I created a ticket saying it needs a refactoring. 
>
> At a high level, I think this is a good compromise. It is fully backwards 
> compatible for people that don't use streaming — the vast majority of 
> Django users. It provides a robust foundation for the minority who does. It 
> takes a bit more work than your current patch :) 
>
>
> In addition, I'm -1 on encoding include or exclude filters in the 
> MIDDLEWARE_CLASSES setting. Chains of includes and excludes are never a 
> good idea — anyone who's struggled with a complex Apache configuration 
> knows what I'm talking about! 
>
>
> Best regards, 
>
> -- 
> Aymeric. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/PzjhRg-tlXMJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to