Hi,

I pushed http.client to a scenario where I would read streaming HTTP
data (yeah, without going into native async) with a select() on
HTTPResponse and using its read1().
Because HTTPResponse has a fileno() we're tempted to use select() on
it, which works kind-of well... but there is one edge case.

While consuming the HTTP response headers, HTTPResponse performs the 
buffered reading of the response (made by socket.makefile()) which may 
leave pending buffered payload data.
In that case and when no more data is coming just yet, the select() is 
blocking despite some data available in buffers.

While it's possible to set a custom HTTP response class in http.client,
it would seem interesting (but I may be lacking background) to be able
to retrieve the pending buffered data using arguments to peek() or
read() on a BufferedReader, without accessing the underlying stream.


What do you think?


Regards,

-- 
Jérôme
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/L77QEBCXUMQQ6A7PXFLUB6MVPKXMWYYQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to