When writing the client to adjust the output flow interface, the easiest pit to step on is only one global total timeout: set short, the model is clearly cut in the stable and stable spit result half way; set too long or even time, the upstream card will be full.
It will be clear to open and disassemble according to the idea of HTTPX: the maximum pause of the next data such as the connection construction connection, the main stop, the pool tube and other connection pool distribution, and then set a separate business deadline outside. As long as the long text is still in the continuous vomiting block, read will not be misjudged; once the user is actively canceled, the upstream response stream is turned off and connected in the first time.
When positioning slow request, you can look at the card in the connection pool queuing, building a company or the first package waiting, the inspection efficiency is too much.