You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the source code, I found that the only difference between FlowControlStreamReader and StreamReader is each method at FlowControlStreamReader is a simple wrapper from StreamReader.
For example, here is the read method at FlowControlStreamReader:
self._stream.resume_stream()
try:
return (yield from super().read(n))
finally:
self._stream.pause_stream()
I also found that the FlowControlStreamReader is use to be a request payload
My confusion is that, why we have to resume_stream first and finally pause_stream at the end, can't we just use StreamReader to replace FlowControlStreamReader as a request payload ?
Thanks a lot !
The text was updated successfully, but these errors were encountered:
it is not possible to replace FlowControlStreamReader, it is required for flow control on socket transport. without it upload or download of big payloads would use all memory.
From the source code, I found that the only difference between FlowControlStreamReader and StreamReader is each method at FlowControlStreamReader is a simple wrapper from StreamReader.
For example, here is the
read
method at FlowControlStreamReader:I also found that the FlowControlStreamReader is use to be a
request payload
My confusion is that, why we have to
resume_stream
first and finallypause_stream
at the end, can't we just useStreamReader
to replaceFlowControlStreamReader
as arequest payload
?Thanks a lot !
The text was updated successfully, but these errors were encountered: