Opened 17 years ago
Closed 17 years ago
#5165 closed (invalid)
HttpResponse's flush method does not do anything
Reported by: | Owned by: | Malcolm Tredinnick | |
---|---|---|---|
Component: | HTTP handling | Version: | dev |
Severity: | Keywords: | httpresponse flush | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
HttpResponse flush method should flush the content previously written by the write method to the socket but this method doesn't do anything :
def flush(self):
pass
This method should be really useful in some Ajax web application.
Change History (2)
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
HttpResponse classes are agnostic about the downstream communication method. So there's no concept of a socket or network connection for it to flush. I think you're trying to solve some problem with the wrong abstraction here. Comet-style data streaming and trying to have fine-grained control over output chunking would need attention in the HTTP handlers area, not in this class.
The only reason HttpResponse has a flush() method at all is because we need it to behave as a file-like object and some applications require flush() to exist (although it need not do anything, as noted by the Python docs).
You might wish to raise whatever problem you are trying to solve on django-users to get some ideas about how to handle it.