]> git.ipfire.org Git - thirdparty/starlette.git/commit
Use `Iterable` instead `Iterator` on `iterate_in_threadpool` (#2362)
authorJames Braza <jamesbraza@gmail.com>
Wed, 20 Dec 2023 21:59:58 +0000 (13:59 -0800)
committerGitHub <noreply@github.com>
Wed, 20 Dec 2023 21:59:58 +0000 (14:59 -0700)
commit966f0fc85764bd478d7c582fc8e2e5f91dbebae6
treef59bd0c38128c3564a56aab7a352ced470df7a44
parent866a15f79c7f15b5dba695ed2180922b7191a19e
Use `Iterable` instead `Iterator` on `iterate_in_threadpool` (#2362)

* Fixed AsyncContentStream to be AsyncIterator

* Updating isinstance check too

* Standardizing on Iterable/AsyncIterable

* Moved iterate_in_threadpool to make an iter internally

* Added test of iterate_in_threadpool accepting an Iterable

* Renamed arg to iterator, and fixed type hint in return to be AsyncIterator

---------

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
starlette/concurrency.py
starlette/responses.py
tests/test_concurrency.py