fix: resolve async stream resource leak on timeout
JO
1y ago+33+33+01234567890123456789-4-4-0123456789
Hello everyone! I got an error when running the tests and saw that there was already a issue related to this (#3686)
Summary
Fix async stream resource leak that caused ResourceWarning in Trio, basically replacing ByteStream.aiter() async generator with a iterator that can be properly closed via aclose()
Checklist
- I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- I've updated the documentation accordingly.