]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Drop `iterate_in_threadpool` and `iterate` (#564)
authorTom Christie <tom@tomchristie.com>
Fri, 29 Nov 2019 11:45:40 +0000 (11:45 +0000)
committerGitHub <noreply@github.com>
Fri, 29 Nov 2019 11:45:40 +0000 (11:45 +0000)
* Drop iterate_in_threadpool

* Drop iterate from concurrency backends

httpx/concurrency/base.py

index a8d44f07ad1678fa1a01661e803f6605334cc1f8..172e7c2d5c87cc9f966a45b062f41b3b8315f4f5 100644 (file)
@@ -129,34 +129,11 @@ class ConcurrencyBackend:
     ) -> typing.Any:
         raise NotImplementedError()  # pragma: no cover
 
-    async def iterate_in_threadpool(self, iterator):  # type: ignore
-        class IterationComplete(Exception):
-            pass
-
-        def next_wrapper(iterator):  # type: ignore
-            try:
-                return next(iterator)
-            except StopIteration:
-                raise IterationComplete()
-
-        while True:
-            try:
-                yield await self.run_in_threadpool(next_wrapper, iterator)
-            except IterationComplete:
-                break
-
     def run(
         self, coroutine: typing.Callable, *args: typing.Any, **kwargs: typing.Any
     ) -> typing.Any:
         raise NotImplementedError()  # pragma: no cover
 
-    def iterate(self, async_iterator):  # type: ignore
-        while True:
-            try:
-                yield self.run(async_iterator.__anext__)
-            except StopAsyncIteration:
-                break
-
     def create_event(self) -> BaseEvent:
         raise NotImplementedError()  # pragma: no cover