Skip to content
Discussion options

You must be logged in to vote

I think I figured out how to do what I want -- and this appears to suffice for my current use cases without any of the hax like the above being needed ...

In my case, I could simply adjust the outermost loop consuming and transorming/processing the stream_response.iter_bytes() to simply break out of that loop when an early exit state has been identified. That can be done without anyone calling close() on any of the Client/Response objects. The stream and connection can then go through the normal shutdown logic when the context manager scope has ended and nothing will ever bubble up into my code ...

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by breathe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant